Class Overview
Helper class for keeping Lists of Objects associated with keys. WARNING: THIS CLASS IS NOT THREAD SAFE
Summary
Public Methods |
Map<K, Set<V>>
|
getMap()
|
int
|
put(K key, V val)
Adds val to the Set associated with key in the Map.
|
int
|
putAll(K key, Collection<? extends V> vals)
Adds multiple vals to the Set associated with key in the Map.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
Public Constructors
public
MapOfSets
(Map<K, Set<V>> m)
Parameters
m
| the backing store for this object
|
Public Methods
public
Map<K, Set<V>>
getMap
()
Returns
- direct access to the map backing this object.
public
int
put
(K key, V val)
Adds val to the Set associated with key in the Map. If key is not
already in the map, a new Set will first be created.
Returns
- the size of the Set associated with key once val is added to it.
public
int
putAll
(K key, Collection<? extends V> vals)
Adds multiple vals to the Set associated with key in the Map.
If key is not
already in the map, a new Set will first be created.
Returns
- the size of the Set associated with key once val is added to it.