gnu.trove
public class THashSet extends TObjectHash implements Set, Serializable
Version: $Id: THashSet.java,v 1.11 2003/03/23 04:06:59 ericdf Exp $
Nested Class Summary | |
---|---|
class | THashSet.HashProcedure |
Constructor Summary | |
---|---|
THashSet()
Creates a new THashSet instance with the default
capacity and load factor. | |
THashSet(TObjectHashingStrategy strategy)
Creates a new THashSet instance with the default
capacity and load factor.
| |
THashSet(int initialCapacity)
Creates a new THashSet instance with a prime
capacity equal to or greater than initialCapacity and
with the default load factor.
| |
THashSet(int initialCapacity, TObjectHashingStrategy strategy)
Creates a new THashSet instance with a prime
capacity equal to or greater than initialCapacity and
with the default load factor.
| |
THashSet(int initialCapacity, float loadFactor)
Creates a new THashSet instance with a prime
capacity equal to or greater than initialCapacity and
with the specified load factor.
| |
THashSet(int initialCapacity, float loadFactor, TObjectHashingStrategy strategy)
Creates a new THashSet instance with a prime
capacity equal to or greater than initialCapacity and
with the specified load factor.
| |
THashSet(Collection collection)
Creates a new THashSet instance containing the
elements of collection.
| |
THashSet(Collection collection, TObjectHashingStrategy strategy)
Creates a new THashSet instance containing the
elements of collection.
|
Method Summary | |
---|---|
boolean | add(Object obj)
Inserts a value into the set.
|
boolean | addAll(Collection collection)
Adds all of the elements in collection to the set.
|
void | clear()
Empties the set. |
boolean | containsAll(Collection collection)
Tests the set to determine if all of the elements in
collection are present.
|
boolean | equals(Object other) |
int | hashCode() |
Iterator | iterator()
Creates an iterator over the values of the set. |
void | readObject(ObjectInputStream stream) |
protected void | rehash(int newCapacity)
Expands the set to accomodate new values.
|
boolean | remove(Object obj)
Removes obj from the set.
|
boolean | removeAll(Collection collection)
Removes all of the elements in collection from the set.
|
boolean | retainAll(Collection collection)
Removes any values in the set which are not contained in
collection.
|
Object[] | toArray()
Returns a new array containing the objects in the set.
|
Object[] | toArray(Object[] a)
Returns a typed array of the objects in the set.
|
void | writeObject(ObjectOutputStream stream) |
THashSet
instance with the default
capacity and load factor.THashSet
instance with the default
capacity and load factor.
Parameters: strategy used to compute hash codes and to compare objects.
THashSet
instance with a prime
capacity equal to or greater than initialCapacity and
with the default load factor.
Parameters: initialCapacity an int
value
THashSet
instance with a prime
capacity equal to or greater than initialCapacity and
with the default load factor.
Parameters: initialCapacity an int
value strategy used to compute hash codes and to compare objects.
THashSet
instance with a prime
capacity equal to or greater than initialCapacity and
with the specified load factor.
Parameters: initialCapacity an int
value loadFactor a float
value
THashSet
instance with a prime
capacity equal to or greater than initialCapacity and
with the specified load factor.
Parameters: initialCapacity an int
value loadFactor a float
value strategy used to compute hash codes and to compare objects.
THashSet
instance containing the
elements of collection.
Parameters: collection a Collection
value
THashSet
instance containing the
elements of collection.
Parameters: collection a Collection
value strategy used to compute hash codes and to compare objects.
Parameters: obj an Object
value
Returns: true if the set was modified by the add operation
Parameters: collection a Collection
value
Returns: true if the set was modified by the add all operation.
Parameters: collection a Collection
value
Returns: true if all elements were present in the set.
Returns: an Iterator
value
Parameters: newCapacity an int
value
Parameters: obj an Object
value
Returns: true if the set was modified by the remove operation.
Parameters: collection a Collection
value
Returns: true if the set was modified by the remove all operation.
Parameters: collection a Collection
value
Returns: true if the set was modified by the retain all operation
Returns: an Object[]
value
Parameters: a an Object[]
value
Returns: an Object[]
value