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.

Version:
2.0.2
Author:
ObjectSpace, Inc.
See Also:
SetOperations, HashSet, HashSetExamples, HashSet

Constructor Index

 o HashMultiSet()
Construct myself to be an empty HashMultiSet that compares objects using equals().
 o HashMultiSet(BinaryPredicate)
Construct myself to be an empty HashMultiSet that compares objects using the specified binary predicate.
 o HashMultiSet(BinaryPredicate, int, float)
Construct myself to be an empty HashMultiSet that compares objects using the specified binary predicate.
 o HashMultiSet(HashMultiSet)
Construct myself to be a shallow copy of an existing HashMultiSet.

Method Index

 o clone()
Return a shallow copy of myself.
 o copy(HashMultiSet)
Become a shallow copy of an existing HashMultiSet.
 o equals(HashMultiSet)
Return true if I contain exactly the same items as another HashMultiSet.
 o equals(Object)
Return true if I'm equal to another object.
 o swap(HashMultiSet)
Swap my contents with another HashMultiSet.
 o toString()
Return a string that describes me.

Constructors

 o HashMultiSet
 public HashMultiSet()
Construct myself to be an empty HashMultiSet that compares objects using equals().

 o 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.
 o 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.
 o HashMultiSet
 public HashMultiSet(HashMultiSet set)
Construct myself to be a shallow copy of an existing HashMultiSet.

Parameters:
set - The HashMultiSet to copy.

Methods

 o clone
 public synchronized Object clone()
Return a shallow copy of myself.

Overrides:
clone in class HashSet
 o 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.
 o toString
 public synchronized String toString()
Return a string that describes me.

Overrides:
toString in class HashSet
 o 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
 o 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.
 o 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