All Packages Class Hierarchy This Package Previous Next Index
Class COM.objectspace.jgl.HashMultiSet
java.lang.Object
|
+----COM.objectspace.jgl.HashSet
|
+----COM.objectspace.jgl.HashMultiSet
- public class HashMultiSet
- extends HashSet
Note: HashMultiSet is deprecated.
A HashMultiSet is a container that is optimized for fast associative lookup. Items are
matched using a BinaryPredicate which is EqualTo() by default. When an item is
inserted into a HashMultiSet, it is stored in a data structure that allows the item
to be found very quickly. Items are stored in buckets based on their hash value,
computed using the standard function hashCode().
A HashMultiSet may contain items that match.
HashMultiSets are useful when fast associate lookup is important, and when index-based lookup is
unnecessary.
Insertion can invalidate iterators.
Removal can invalidate iterators.
- See Also:
- SetOperations, HashSet, HashSetExamples, HashSet
-
HashMultiSet()
- Construct myself to be an empty HashMultiSet that compares objects using equals().
-
HashMultiSet(BinaryPredicate)
- Construct myself to be an empty HashMultiSet that compares objects using the specified
binary predicate.
-
HashMultiSet(BinaryPredicate, int, float)
- Construct myself to be an empty HashMultiSet that compares objects using the specified
binary predicate.
-
HashMultiSet(HashMultiSet)
- Construct myself to be a shallow copy of an existing HashMultiSet.
-
clone()
- Return a shallow copy of myself.
-
copy(HashMultiSet)
- Become a shallow copy of an existing HashMultiSet.
-
equals(HashMultiSet)
- Return true if I contain exactly the same items as another HashMultiSet.
-
equals(Object)
- Return true if I'm equal to another object.
-
swap(HashMultiSet)
- Swap my contents with another HashMultiSet.
-
toString()
- Return a string that describes me.
HashMultiSet
public HashMultiSet()
- Construct myself to be an empty HashMultiSet that compares objects using equals().
HashMultiSet
public HashMultiSet(BinaryPredicate comparator)
- Construct myself to be an empty HashMultiSet that compares objects using the specified
binary predicate.
- Parameters:
- comparator - The predicate for comparing objects.
HashMultiSet
public HashMultiSet(BinaryPredicate comparator,
int capacity,
float loadRatio)
- Construct myself to be an empty HashMultiSet that compares objects using the specified
binary predicate. The initial capacity and load ratio must also be specified.
- Parameters:
- comparator - The predicate for comparing objects.
- capacity - The initial number of hash buckets to reserve.
- loadRatio - The maximum load ratio.
HashMultiSet
public HashMultiSet(HashMultiSet set)
- Construct myself to be a shallow copy of an existing HashMultiSet.
- Parameters:
- set - The HashMultiSet to copy.
clone
public synchronized Object clone()
- Return a shallow copy of myself.
- Overrides:
- clone in class HashSet
copy
public synchronized void copy(HashMultiSet set)
- Become a shallow copy of an existing HashMultiSet.
- Parameters:
- set - The HashMultiSet that I shall become a shallow copy of.
toString
public synchronized String toString()
- Return a string that describes me.
- Overrides:
- toString in class HashSet
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 HashSet
equals
public synchronized boolean equals(HashMultiSet set)
- Return true if I contain exactly the same items as another HashMultiSet.
Use equals() to compare the individual elements.
- Parameters:
- set - The HashMultiSet to compare myself against.
swap
public synchronized void swap(HashMultiSet set)
- Swap my contents with another HashMultiSet.
- Parameters:
- set - The HashMultiSet that I will swap my contents with.
All Packages Class Hierarchy This Package Previous Next Index