gnu.trove.set.hash
Class TLinkedHashSet<E>
- java.lang.Object
-
- gnu.trove.impl.hash.THash
-
- gnu.trove.impl.hash.TObjectHash<E>
-
- gnu.trove.set.hash.THashSet<E>
-
- gnu.trove.set.hash.TLinkedHashSet<E>
-
- All Implemented Interfaces:
- java.io.Externalizable, java.io.Serializable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>
public class TLinkedHashSet<E> extends THashSet<E>
Created by IntelliJ IDEA. User: Johan Date: 15/03/11 Time: 18:15 To change this template use File | Settings | File Templates.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class gnu.trove.impl.hash.TObjectHash
_set, FREE, REMOVED
-
-
Constructor Summary
Constructors Constructor and Description TLinkedHashSet()Creates a newTHashSetinstance with the default capacity and load factor.TLinkedHashSet(java.util.Collection<? extends E> es)Creates a newTHashSetinstance containing the elements of collection.TLinkedHashSet(int initialCapacity)Creates a newTHashSetinstance with a prime capacity equal to or greater than initialCapacity and with the default load factor.TLinkedHashSet(int initialCapacity, float loadFactor)Creates a newTHashSetinstance with a prime capacity equal to or greater than initialCapacity and with the specified load factor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanadd(E obj)Inserts a value into the set.voidclear()Empties the set.booleanforEach(TObjectProcedure<? super E> procedure)Executes procedure for each element in the set.TObjectHashIterator<E>iterator()Creates an iterator over the values of the set.intsetUp(int initialCapacity)initializes the Object set of this hash table.java.lang.StringtoString()-
Methods inherited from class gnu.trove.set.hash.THashSet
addAll, containsAll, equals, hashCode, readExternal, remove, removeAll, retainAll, toArray, toArray, writeExternal
-
Methods inherited from class gnu.trove.impl.hash.TObjectHash
capacity, contains
-
Methods inherited from class gnu.trove.impl.hash.THash
compact, ensureCapacity, getAutoCompactionFactor, isEmpty, reenableAutoCompaction, setAutoCompactionFactor, size, tempDisableAutoCompaction, trimToSize
-
-
-
-
Constructor Detail
-
TLinkedHashSet
public TLinkedHashSet()
Creates a newTHashSetinstance with the default capacity and load factor.
-
TLinkedHashSet
public TLinkedHashSet(int initialCapacity)
Creates a newTHashSetinstance with a prime capacity equal to or greater than initialCapacity and with the default load factor.- Parameters:
initialCapacity- anintvalue
-
TLinkedHashSet
public TLinkedHashSet(int initialCapacity, float loadFactor)Creates a newTHashSetinstance with a prime capacity equal to or greater than initialCapacity and with the specified load factor.- Parameters:
initialCapacity- anintvalueloadFactor- afloatvalue
-
TLinkedHashSet
public TLinkedHashSet(java.util.Collection<? extends E> es)
Creates a newTHashSetinstance containing the elements of collection.- Parameters:
es- aCollectionvalue
-
-
Method Detail
-
setUp
public int setUp(int initialCapacity)
initializes the Object set of this hash table.- Overrides:
setUpin classTObjectHash<E>- Parameters:
initialCapacity- anintvalue- Returns:
- an
intvalue
-
clear
public void clear()
Empties the set.
-
add
public boolean add(E obj)
Inserts a value into the set.
-
iterator
public TObjectHashIterator<E> iterator()
Creates an iterator over the values of the set. The iterator supports element deletion.
-
forEach
public boolean forEach(TObjectProcedure<? super E> procedure)
Executes procedure for each element in the set.- Overrides:
forEachin classTObjectHash<E>- Parameters:
procedure- aTObjectProcedurevalue- Returns:
- false if the loop over the set terminated because the procedure returned false for some value.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG