|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectMultiMap<T1,T2>
public class MultiMap<T1,T2> extends Object implements IMultiMap<T1,T2>
Implements an IMultiMap with a java.util.LinkedHashMap.
| Constructor and Description |
|---|
MultiMap()
|
MultiMap(int i)
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(T1 key,
T2 value)
Precondition: the mapping key->value is not already in the map. |
void |
addAll(Map<? extends T1,? extends T2> m)
|
void |
addAll(T1 key,
Collection<? extends T2> values)
|
void |
clear()
|
boolean |
contains(T1 obj)
|
Set<T2> |
getValues(T1 key)
Returns the values that the given key maps to. |
boolean |
isEmpty()
|
Set<T1> |
keySet()
Returns the set of keys in this map (the domain). |
void |
put(T1 key,
Collection<? extends T2> values)
|
void |
remove(T1 key)
|
void |
remove(T1 key,
T2 value)
Precondition: the mapping key->value is in the map. |
int |
size()
Returns the size of this map: the number of mappings. |
String |
toString()
Returns a String representation of this map. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MultiMap()
public MultiMap(int i)
| Method Detail |
|---|
public void put(T1 key,
Collection<? extends T2> values)
public void addAll(Map<? extends T1,? extends T2> m)
public void addAll(T1 key,
Collection<? extends T2> values)
public void add(T1 key,
T2 value)
IMultiMap
add in interface IMultiMap<T1,T2>key - cannot be null.value - cannot be null.
public void remove(T1 key,
T2 value)
IMultiMap
remove in interface IMultiMap<T1,T2>key - cannot be null.value - cannot be null.public void remove(T1 key)
public Set<T2> getValues(T1 key)
IMultiMap
getValues in interface IMultiMap<T1,T2>key - cannot be null.public Set<T1> keySet()
IMultiMap
keySet in interface IMultiMap<T1,T2>public boolean contains(T1 obj)
public void clear()
public int size()
IMultiMap
size in interface IMultiMap<T1,T2>public boolean isEmpty()
public String toString()
IMultiMap
toString in interface IMultiMap<T1,T2>toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||