All Packages Class Hierarchy This Package Previous Next Index
Class COM.objectspace.jgl.HashMultiMap
java.lang.Object
|
+----java.util.Dictionary
|
+----COM.objectspace.jgl.Map
|
+----COM.objectspace.jgl.HashMap
|
+----COM.objectspace.jgl.HashMultiMap
- public class HashMultiMap
- extends HashMap
Note: HashMultiMap is deprecated.
A HashMultiMap is an associative container that manages a set of key/value pairs.
A pair is stored in a hashing structure based on the hash code of its key, which
is obtained by using the standard hashCode() function. Keys are matched using
a BinaryPredicate which is EqualTo() by default. Duplicates keys are allowed.
A HashMultiMap is useful for implementing a collection of one-to-many
mappings.
Insertion can invalidate iterators.
Removal can invalidate iterators.
- See Also:
- HashMap, HashMapExamples, HashMap
-
HashMultiMap()
- Construct myself to be an empty HashMultiMap that compares key using equals().
-
HashMultiMap(BinaryPredicate)
- Construct myself to be an empty HashMultiMap that compares keys using the specified
binary predicate.
-
HashMultiMap(BinaryPredicate, int, float)
- Construct myself to be an empty HashMultiMap that compares keys using the specified
binary predicate.
-
HashMultiMap(HashMultiMap)
- Construct myself to be a shallow copy of an existing HashMultiMap.
-
clone()
- Return a shallow copy of myself.
-
equals(HashMultiMap)
- Return true if I contain exactly the same key/value pairs as another HashMultiMap.
-
equals(Object)
- Return true if I'm equal to another object.
-
swap(HashMultiMap)
- Swap my contents with another HashMultiMap.
-
toString()
- Return a string that describes me.
HashMultiMap
public HashMultiMap()
- Construct myself to be an empty HashMultiMap that compares key using equals().
HashMultiMap
public HashMultiMap(BinaryPredicate comparator)
- Construct myself to be an empty HashMultiMap that compares keys using the specified
binary predicate.
- Parameters:
- comparator - The predicate for comparing keys.
HashMultiMap
public HashMultiMap(BinaryPredicate comparator,
int capacity,
float loadRatio)
- Construct myself to be an empty HashMultiMap that compares keys using the specified
binary predicate. The initial buckets and load ratio must also be specified.
- Parameters:
- comparator - The predicate for comparing keys.
- capacity - The initial number of hash buckets to reserve.
- loadRatio - The maximum load ratio.
HashMultiMap
public HashMultiMap(HashMultiMap map)
- Construct myself to be a shallow copy of an existing HashMultiMap.
- Parameters:
- map - The HashMultiMap to copy.
clone
public synchronized Object clone()
- Return a shallow copy of myself.
- Overrides:
- clone in class HashMap
toString
public synchronized String toString()
- Return a string that describes me.
- Overrides:
- toString in class HashMap
equals
public boolean equals(Object object)
- Return true if I'm equal to another object.
- Parameters:
- object - The object to compare myself against.
- Overrides:
- equals in class HashMap
equals
public synchronized boolean equals(HashMultiMap map)
- Return true if I contain exactly the same key/value pairs as another HashMultiMap.
Use equals() to compare values.
- Parameters:
- map - The HashMultiMap to compare myself against.
swap
public synchronized void swap(HashMultiMap map)
- Swap my contents with another HashMultiMap.
- Parameters:
- map - The HashMultiMap that I will swap my contents with.
All Packages Class Hierarchy This Package Previous Next Index