|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jvnet.hk2.component.MultiMap<K,V>
@Deprecated public class MultiMap<K,V>
Map from a key to multiple values. Order is significant among values, and null values are allowed, although null keys are not.
Constructor Summary | |
---|---|
|
MultiMap()
Deprecated. Creates an empty multi-map with default concurrency controls |
protected |
MultiMap(Map<K,List<V>> store,
boolean concurrencyControls)
Deprecated. Creates a multi-map backed by the given store. |
|
MultiMap(MultiMap<K,V> base)
Deprecated. Copy constructor. |
Method Summary | ||
---|---|---|
void |
add(K k,
V v)
Deprecated. Adds one more key-value pair. |
|
MultiMap<K,V> |
clone()
Deprecated. Creates a copy of the map that contains the exact same key and value set. |
|
boolean |
contains(K k1,
V k2)
Deprecated. Checks if the map contains the given key(s), also extending the search to including the sub collection. |
|
boolean |
containsKey(K k)
Deprecated. Checks if the map contains the given key. |
|
static
|
emptyMap()
Deprecated. Gets the singleton read-only empty multi-map. |
|
Set<Map.Entry<K,List<V>>> |
entrySet()
Deprecated. Lists up all entries. |
|
boolean |
equals(Object another)
Deprecated. |
|
List<V> |
get(K k)
Deprecated. Returns the elements indexed by the provided key |
|
V |
getFirst(K k)
Deprecated. Gets the first value if any, or null. |
|
List<V> |
getIntersectionOfAll(Collection<K> keys)
Deprecated. Returns the intersection of all elements indexed by the provided keys. |
|
V |
getOne(K k)
Deprecated. Gets the first value if any, or null. |
|
List<V> |
getUnionOfAll(Collection<K> keys)
Deprecated. Returns the union of all elements indexed by the provided keys. |
|
int |
hashCode()
Deprecated. |
|
Set<K> |
keySet()
Deprecated. Returns the keys of type K. |
|
void |
mergeAll(MultiMap<K,V> another)
Deprecated. |
|
protected List<V> |
newList(Collection<? extends V> initialVals)
Deprecated. Creates an optionally populated list to be used as an entry in the map. |
|
List<V> |
remove(K key)
Deprecated. Removes an key value from the map |
|
boolean |
remove(K key,
V entry)
Deprecated. Removes an key value pair from the map |
|
void |
set(K k,
Collection<? extends V> v)
Deprecated. Replaces all the existing values associated with the key by the given value. |
|
void |
set(K k,
V v)
Deprecated. Replaces all the existing values associated with the key by the given single value. |
|
int |
size()
Deprecated. Returns the size of the map |
|
String |
toCommaSeparatedString()
Deprecated. |
|
String |
toString()
Deprecated. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MultiMap()
protected MultiMap(Map<K,List<V>> store, boolean concurrencyControls)
store
- map to copypublic MultiMap(MultiMap<K,V> base)
base
- map to copyMethod Detail |
---|
public int hashCode()
hashCode
in class Object
public boolean equals(Object another)
equals
in class Object
public String toString()
toString
in class Object
protected List<V> newList(Collection<? extends V> initialVals)
initialVal
-
public Set<K> keySet()
MultiMap
keySet
in interface MultiMap<K,V>
public final void add(K k, V v)
k
- key to store the entry underv
- value to store in the k's values.public void set(K k, Collection<? extends V> v)
k
- key for the valuesv
- Can be null or empty.public void set(K k, V v)
k
- key for the valuesv
- singleton value for k key
This is short for set(k,Collections.singleton(v))public final List<V> get(K k)
get
in interface MultiMap<K,V>
k
- key for the values
public List<V> getUnionOfAll(Collection<K> keys)
keys
- the collection of keys
public List<V> getIntersectionOfAll(Collection<K> keys)
keys
- the collection of keys
public void mergeAll(MultiMap<K,V> another)
public boolean containsKey(K k)
containsKey
in interface MultiMap<K,V>
k
- key to test
public boolean contains(K k1, V k2)
contains
in interface MultiMap<K,V>
k1
- key from top collectionk2
- key (value) from inner collection
public List<V> remove(K key)
key
- key to be removed
public boolean remove(K key, V entry)
key
- key to be removedentry
- the entry to be removed from the key'ed list
public V getOne(K k)
k
- key for the values
public V getFirst(K k)
MultiMap
This is useful when you know the given key only has one value and you'd like to get to that value.
getFirst
in interface MultiMap<K,V>
k
- key for the values
public Set<Map.Entry<K,List<V>>> entrySet()
entrySet
in interface MultiMap<K,V>
Set
of Map.Entry
of entriespublic String toCommaSeparatedString()
public MultiMap<K,V> clone()
clone
in class Object
public int size()
size
in interface MultiMap<K,V>
public static <K,V> MultiMap<K,V> emptyMap()
Collections.emptyMap()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |