Class CommonsHashSet<ELEMENTTYPE>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- java.util.HashSet<ELEMENTTYPE>
-
- com.helger.commons.collection.impl.CommonsHashSet<ELEMENTTYPE>
-
- Type Parameters:
ELEMENTTYPE- Set element type
- All Implemented Interfaces:
ICommonsCollection<ELEMENTTYPE>,ICommonsIterable<ELEMENTTYPE>,ICommonsSet<ELEMENTTYPE>,ICloneable<ICommonsSet<ELEMENTTYPE>>,IHasSize,Serializable,Cloneable,Iterable<ELEMENTTYPE>,Collection<ELEMENTTYPE>,Set<ELEMENTTYPE>
public class CommonsHashSet<ELEMENTTYPE> extends HashSet<ELEMENTTYPE> implements ICommonsSet<ELEMENTTYPE>
A specialHashSetimplementation based onICommonsSet.- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CommonsHashSet()CommonsHashSet(int nInitialCapacity)CommonsHashSet(int nInitialCapacity, float fLoadFactor)CommonsHashSet(ELEMENTTYPE aValue)CommonsHashSet(ELEMENTTYPE... aValues)CommonsHashSet(Iterable<? extends ELEMENTTYPE> aIterable)CommonsHashSet(Iterable<? extends SRCTYPE> aValues, Function<? super SRCTYPE,? extends ELEMENTTYPE> aMapper)CommonsHashSet(Collection<? extends ELEMENTTYPE> aCont)CommonsHashSet(Collection<? extends SRCTYPE> aValues, Function<? super SRCTYPE,? extends ELEMENTTYPE> aMapper)CommonsHashSet(SRCTYPE[] aValues, Function<? super SRCTYPE,? extends ELEMENTTYPE> aMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> CommonsHashSet<T>createInstance()Create a new empty set.CommonsHashSet<ELEMENTTYPE>getClone()-
Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size, spliterator
-
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
-
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface com.helger.commons.collection.impl.ICommonsCollection
addAll, addAll, addAll, addAll, addAll, addAll, addAll, addAll, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addIf, addIfNotNull, addObject, getAtIndex, getAtIndex, getAtIndex, getAtIndex, getAtIndexMapped, getAtIndexMapped, getAtIndexMapped, getAtIndexMapped, getCopyAsList, getCount, getSorted, iterator2, removeAll, removeObject, set, setAll, setAll, setAllMapped, setAllMapped
-
Methods inherited from interface com.helger.commons.collection.impl.ICommonsIterable
containsAny, containsNone, containsOnly, findAll, findAllInstanceOf, findAllMapped, findAllMapped, findAllMapped, findFirst, findFirst, findFirstIndex, findFirstMapped, findFirstMapped, findLastIndex, forEach, forEachBreakable, forEachByIndex, getCount
-
Methods inherited from interface com.helger.commons.collection.impl.ICommonsSet
getAll, getAllInstanceOf, getAllMapped, getAllMapped, getAsUnmodifiable, replace
-
Methods inherited from interface com.helger.commons.lang.IHasSize
isEmpty, isNotEmpty, size
-
-
-
-
Constructor Detail
-
CommonsHashSet
public CommonsHashSet()
-
CommonsHashSet
public CommonsHashSet(int nInitialCapacity)
-
CommonsHashSet
public CommonsHashSet(int nInitialCapacity, @Nonnegative float fLoadFactor)
-
CommonsHashSet
public CommonsHashSet(@Nullable Collection<? extends ELEMENTTYPE> aCont)
-
CommonsHashSet
public CommonsHashSet(@Nullable Iterable<? extends ELEMENTTYPE> aIterable)
-
CommonsHashSet
public CommonsHashSet(@Nullable Collection<? extends SRCTYPE> aValues, @Nonnull Function<? super SRCTYPE,? extends ELEMENTTYPE> aMapper)
-
CommonsHashSet
public CommonsHashSet(@Nullable Iterable<? extends SRCTYPE> aValues, @Nonnull Function<? super SRCTYPE,? extends ELEMENTTYPE> aMapper)
-
CommonsHashSet
public CommonsHashSet(@Nullable ELEMENTTYPE aValue)
-
CommonsHashSet
@SafeVarargs public CommonsHashSet(@Nullable ELEMENTTYPE... aValues)
-
CommonsHashSet
public CommonsHashSet(@Nullable SRCTYPE[] aValues, @Nonnull Function<? super SRCTYPE,? extends ELEMENTTYPE> aMapper)
-
-
Method Detail
-
createInstance
@Nonnull @ReturnsMutableCopy public <T> CommonsHashSet<T> createInstance()
Description copied from interface:ICommonsSetCreate a new empty set. Overwrite this if you don't want to useCommonsHashSet.- Specified by:
createInstancein interfaceICommonsSet<ELEMENTTYPE>- Type Parameters:
T- Set element type- Returns:
- A new empty set. Never
null.
-
getClone
@Nonnull @ReturnsMutableCopy public CommonsHashSet<ELEMENTTYPE> getClone()
- Specified by:
getClonein interfaceICloneable<ELEMENTTYPE>- Returns:
- A 100% deep-copy of the implementing class.
-
-