public class THashSet extends TObjectHash implements Set, Serializable
_set, REMOVED_free, _loadFactor, _maxSize, _size, DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR| Constructor and Description |
|---|
THashSet()
Creates a new
THashSet instance with the default
capacity and 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. |
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,
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(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(TObjectHashingStrategy strategy)
Creates a new
THashSet instance with the default
capacity and load factor. |
| Modifier and Type | Method and Description |
|---|---|
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) |
Iterator |
iterator()
Creates an iterator over the values of the set.
|
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.
|
capacity, clone, computeHashCode, contains, equals, forEach, index, insertionIndex, removeAt, setUpcompact, ensureCapacity, isEmpty, postInsertHook, size, trimToSizefinalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitparallelStream, removeIf, streampublic THashSet()
THashSet instance with the default
capacity and load factor.public THashSet(TObjectHashingStrategy strategy)
THashSet instance with the default
capacity and load factor.strategy - used to compute hash codes and to compare objects.public THashSet(int initialCapacity)
THashSet instance with a prime
capacity equal to or greater than initialCapacity and
with the default load factor.initialCapacity - an int valuepublic THashSet(int initialCapacity,
TObjectHashingStrategy strategy)
THashSet instance with a prime
capacity equal to or greater than initialCapacity and
with the default load factor.initialCapacity - an int valuestrategy - used to compute hash codes and to compare objects.public THashSet(int initialCapacity,
float loadFactor)
THashSet instance with a prime
capacity equal to or greater than initialCapacity and
with the specified load factor.initialCapacity - an int valueloadFactor - a float valuepublic THashSet(int initialCapacity,
float loadFactor,
TObjectHashingStrategy strategy)
THashSet instance with a prime
capacity equal to or greater than initialCapacity and
with the specified load factor.initialCapacity - an int valueloadFactor - a float valuestrategy - used to compute hash codes and to compare objects.public THashSet(Collection collection)
THashSet instance containing the
elements of collection.collection - a Collection valuepublic THashSet(Collection collection, TObjectHashingStrategy strategy)
THashSet instance containing the
elements of collection.collection - a Collection valuestrategy - used to compute hash codes and to compare objects.public boolean add(Object obj)
add in interface Collectionadd in interface Setobj - an Object valuepublic boolean equals(Object other)
protected void rehash(int newCapacity)
public Object[] toArray()
toArray in interface CollectiontoArray in interface SetObject[] valuepublic Object[] toArray(Object[] a)
toArray in interface CollectiontoArray in interface Seta - an Object[] valueObject[] valuepublic void clear()
public boolean remove(Object obj)
remove in interface Collectionremove in interface Setobj - an Object valuepublic Iterator iterator()
public boolean containsAll(Collection collection)
containsAll in interface CollectioncontainsAll in interface Setcollection - a Collection valuepublic boolean addAll(Collection collection)
addAll in interface CollectionaddAll in interface Setcollection - a Collection valuepublic boolean removeAll(Collection collection)
removeAll in interface CollectionremoveAll in interface Setcollection - a Collection valuepublic boolean retainAll(Collection collection)
retainAll in interface CollectionretainAll in interface Setcollection - a Collection valueCopyright © 2019 JULIE Lab, Germany. All rights reserved.