|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groiss.ds.MultiMap
public class MultiMap
A MultiMap maps keys to objects, where one key can be mapped to a set of objects.
| Constructor Summary | |
|---|---|
MultiMap()
Constructs a MultiMap. |
|
MultiMap(int initialSubSize)
Constructs a MultiMap and specifies an initial size for the Vectors holding the values to the keys. |
|
MultiMap(int capacity,
int initialSubSize)
Creates a new MultiMap with the defined capacity and Vector size. |
|
| Method Summary | |
|---|---|
boolean |
containsKey(java.lang.Object key)
Use this method to find out if the given key exists in this MultiMap. |
int |
count(java.lang.Object key)
Returns number of values mapped to a given key. |
java.util.Enumeration |
elements()
Returns the elements in the map |
java.util.Enumeration |
get(java.lang.Object key)
Returns all values mapped to a given key. |
java.util.Vector |
getEntries(java.lang.Object key)
Returns all values mapped to a given key. |
boolean |
hasValue(java.lang.Object key,
java.lang.Object value)
Finds out if the object key has a mapping to the object
value. |
boolean |
isEmpty()
Is the map emtpy? |
java.util.Enumeration |
keys()
Return the keys |
java.util.Set |
keySet()
Return the keys |
void |
put(java.lang.Object key,
java.lang.Object value)
Put the mapping of a key and an object to the map. |
void |
putAll(java.lang.Object key,
java.util.List values)
Put the mapping of a key to a list of values to the map. |
void |
remove(java.lang.Object key)
Removes a key from the map. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MultiMap()
public MultiMap(int initialSubSize)
initialSubSize - New Vectors will be created with this size.
public MultiMap(int capacity,
int initialSubSize)
capacity - The Map will have this initial size. The load factor is the standard value of 0.75.initialSubSize - New Vectors will be created with this size.| Method Detail |
|---|
public void put(java.lang.Object key,
java.lang.Object value)
key - a keyvalue - the value object.
public void putAll(java.lang.Object key,
java.util.List values)
key - a keyvalues - the values fo the keypublic java.util.Enumeration get(java.lang.Object key)
key - the key object
public boolean hasValue(java.lang.Object key,
java.lang.Object value)
key has a mapping to the object
value.
key - The key object.value - The desired value object.
true if the key object contains a mapping to the given
value object. In all other cases (also if the key doesn't exist at all),
false will be returned.public boolean containsKey(java.lang.Object key)
key - The key object.
true if the key exists, else false will
be returned.public int count(java.lang.Object key)
key - the key object
public java.util.Vector getEntries(java.lang.Object key)
key - the key object
public void remove(java.lang.Object key)
key - the key objectpublic java.util.Enumeration elements()
public java.util.Enumeration keys()
public java.util.Set keySet()
public boolean isEmpty()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||