com.atlassian.jira.util.collect
Interface MultiMap<K,V,C extends Collection<V>>

All Superinterfaces:
Map<K,C>

public interface MultiMap<K,V,C extends Collection<V>>
extends Map<K,C>


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Method Summary
 C allValues()
          Get all elements in all Collections.
 boolean contains(Object value)
          Does this MultiMap contain the value in any of its value collections.
 boolean containsValue(Collection<?> value)
          Does this MultiMap contain the Collection as any of its value collections.
 void copyTo(Collection<V> collection)
          Copy all values to the supplied collection.
 boolean putSingle(K key, V value)
          Put a single value in to the appropriate mapped collection.
 int sizeAll()
          The sum of sizes of all contained keys.
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Method Detail

allValues

C allValues()
Get all elements in all Collections. This returns the same type as the mapped Collections, so if this MultiMap contains lists then there will be the same number of elements as sizeAll(), whereas if the MultiMap contains sets then duplicates may be removed. If a different type of Collection

The returned Collection is immutable.

Returns:
a Collection

sizeAll

int sizeAll()
The sum of sizes of all contained keys. May be different to calling Map.size() on the result of allValues()

Returns:
the total number of elements in all mapped collections.

putSingle

boolean putSingle(K key,
                  V value)
Put a single value in to the appropriate mapped collection.

Parameters:
key - the Key
value - the single value to add to the collection for this key
Returns:
whether the Collection was modified.

contains

boolean contains(Object value)
Does this MultiMap contain the value in any of its value collections.

Parameters:
value - the single value to check for
Returns:
true if the value is contained in any of the mapped collections

containsValue

boolean containsValue(Collection<?> value)
Does this MultiMap contain the Collection as any of its value collections.

Parameters:
value - the collection to check for
Returns:
true if the value is contained in any of the mapped collections

copyTo

void copyTo(Collection<V> collection)
Copy all values to the supplied collection.

Parameters:
collection - to copy all the values to.


Copyright © 2002-2012 Atlassian. All Rights Reserved.