public class ShortOpenHashSet extends AbstractShortSet implements ITrimmable
ISizeProvider.CollectionSize| Constructor and Description |
|---|
ShortOpenHashSet()
Default Constructor
|
ShortOpenHashSet(java.util.Collection<? extends java.lang.Short> collection)
Deprecated.
|
ShortOpenHashSet(java.util.Collection<? extends java.lang.Short> collection,
float loadFactor)
Deprecated.
|
ShortOpenHashSet(int minCapacity)
Constructor that defines the minimum capacity
|
ShortOpenHashSet(int minCapacity,
float loadFactor)
Constructor that defines the minimum capacity and load factor
|
ShortOpenHashSet(java.util.Iterator<java.lang.Short> iterator)
A Helper constructor that allows to create a set from a iterator of an unknown size
|
ShortOpenHashSet(java.util.Iterator<java.lang.Short> iterator,
float loadFactor)
A Helper constructor that allows to create a set from a iterator of an unknown size
|
ShortOpenHashSet(short[] array)
Helper constructor that allow to create a set from unboxed values
|
ShortOpenHashSet(short[] array,
float loadFactor)
Helper constructor that allow to create a set from unboxed values
|
ShortOpenHashSet(short[] array,
int offset,
int length)
Helper constructor that allow to create a set from unboxed values
|
ShortOpenHashSet(short[] array,
int offset,
int length,
float loadFactor)
Helper constructor that allow to create a set from unboxed values
|
ShortOpenHashSet(ShortCollection collection)
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
|
ShortOpenHashSet(ShortCollection collection,
float loadFactor)
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
|
ShortOpenHashSet(ShortIterator iterator)
A Helper constructor that allows to create a set from a iterator of an unknown size
|
ShortOpenHashSet(ShortIterator iterator,
float loadFactor)
A Helper constructor that allows to create a set from a iterator of an unknown size
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(short o)
A Type-Specific add function to reduce (un)boxing
|
boolean |
addAll(java.util.Collection<? extends java.lang.Short> c)
Deprecated.
|
boolean |
addAll(ShortCollection c)
A Type-Specific addAll function to reduce (un)boxing
|
void |
clear() |
void |
clearAndTrim(int size)
Trims the collection down to the requested size and clears all elements while doing so
|
boolean |
contains(java.lang.Object o)
This default implementation delegates to the corresponding type-specific function.
|
boolean |
contains(short o)
A Type-Specific implementation of contains.
|
ShortOpenHashSet |
copy()
A Function that does a shallow clone of the Collection itself.
|
int |
count(ShortPredicate filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
short |
findFirst(ShortPredicate filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
<E> void |
forEach(E input,
ObjectShortConsumer<E> action)
Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
|
void |
forEach(ShortConsumer action)
A Type Specific foreach function that reduces (un)boxing
|
void |
forEachIndexed(IntShortConsumer action)
A Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.
|
ShortIterator |
iterator()
Returns a Type-Specific Iterator to reduce (un)boxing
|
boolean |
matchesAll(ShortPredicate filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(ShortPredicate filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(ShortPredicate filter)
Helper function to reduce stream usage that allows to filter for no matches.
|
short |
reduce(short identity,
ShortShortUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
short |
reduce(ShortShortUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
boolean |
remove(java.lang.Object o)
This default implementation delegates to the corresponding type-specific function.
|
boolean |
remove(short o)
A Type Specific remove function to reduce boxing/unboxing
|
int |
size() |
boolean |
trim(int size)
Trims the original collection down to the size of the current elements or the requested size depending which is bigger
|
equals, hashCodeadd, containsAll, containsAll, containsAny, containsAny, removeAll, removeAll, remShort, retainAll, retainAll, toShortArray, toShortArrayisEmpty, removeAll, retainAll, toArray, toArray, toStringclearAndTrim, trimadd, remShort, spliterator, synchronize, synchronize, unmodifiablecontainsAll, isEmpty, removeAll, retainAll, toArray, toArrayaddAll, addAll, addAll, containsAll, containsAny, containsAny, parallelPrimitiveStream, pour, primitiveStream, remIf, removeAll, removeAll, removeIf, retainAll, retainAll, toShortArray, toShortArrayarrayflatMap, asAsync, distinct, filter, flatMap, forEach, limit, map, peek, pourAsList, pourAsSet, repeat, sortedofpublic ShortOpenHashSet()
public ShortOpenHashSet(int minCapacity)
minCapacity - the minimum capacity the HashSet is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic ShortOpenHashSet(int minCapacity,
float loadFactor)
minCapacity - the minimum capacity the HashSet is allowed to be.loadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the minimum capacity is negativejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public ShortOpenHashSet(short[] array)
array - the elements that should be put into the setpublic ShortOpenHashSet(short[] array,
float loadFactor)
array - the elements that should be put into the setloadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public ShortOpenHashSet(short[] array,
int offset,
int length)
array - the elements that should be put into the setoffset - the starting index within the array that should be usedlength - the amount of elements used from the arrayjava.lang.IllegalStateException - if offset and length causes to step outside of the arrays rangepublic ShortOpenHashSet(short[] array,
int offset,
int length,
float loadFactor)
array - the elements that should be put into the setoffset - the starting index within the array that should be usedlength - the amount of elements used from the arrayloadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1java.lang.IllegalStateException - if offset and length causes to step outside of the arrays range@Deprecated public ShortOpenHashSet(java.util.Collection<? extends java.lang.Short> collection)
collection - the set the elements should be added to the Set@Deprecated
public ShortOpenHashSet(java.util.Collection<? extends java.lang.Short> collection,
float loadFactor)
collection - the set the elements should be added to the SetloadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public ShortOpenHashSet(ShortCollection collection)
collection - the set the elements should be added to the Setpublic ShortOpenHashSet(ShortCollection collection, float loadFactor)
collection - the set the elements should be added to the SetloadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public ShortOpenHashSet(java.util.Iterator<java.lang.Short> iterator)
iterator - the elements that should be added to the setpublic ShortOpenHashSet(java.util.Iterator<java.lang.Short> iterator,
float loadFactor)
iterator - the elements that should be added to the setloadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public ShortOpenHashSet(ShortIterator iterator)
iterator - the elements that should be added to the setpublic ShortOpenHashSet(ShortIterator iterator, float loadFactor)
iterator - the elements that should be added to the setloadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public boolean add(short o)
ShortCollectionadd in interface ShortCollectiono - the element that should be added@Deprecated public boolean addAll(java.util.Collection<? extends java.lang.Short> c)
AbstractShortCollectionThis default implementation delegates to the corresponding type-specific function.
addAll in interface java.util.Collection<java.lang.Short>addAll in interface java.util.Set<java.lang.Short>addAll in class AbstractShortCollectionpublic boolean addAll(ShortCollection c)
ShortCollectionaddAll in interface ShortCollectionaddAll in class AbstractShortCollectionc - the collection of elements that should be addedpublic boolean contains(java.lang.Object o)
AbstractShortCollectionThis default implementation delegates to the corresponding type-specific function.
This default implementation delegates to the corresponding type-specific function.
contains in interface java.util.Collection<java.lang.Short>contains in interface java.util.Set<java.lang.Short>contains in interface ShortCollectioncontains in interface ShortSetcontains in class AbstractShortCollectionpublic boolean remove(java.lang.Object o)
AbstractShortCollectionThis default implementation delegates to the corresponding type-specific function.
This default implementation delegates to the corresponding type-specific function.
remove in interface java.util.Collection<java.lang.Short>remove in interface java.util.Set<java.lang.Short>remove in interface ShortCollectionremove in interface ShortSetremove in class AbstractShortCollectionpublic boolean contains(short o)
AbstractShortCollectioncontains in interface ShortCollectioncontains in class AbstractShortCollectiono - the element that should be searched for.public boolean remove(short o)
ShortSetpublic boolean trim(int size)
ITrimmabletrim in interface ITrimmablesize - the requested trim size.public void clearAndTrim(int size)
ITrimmableclearAndTrim in interface ITrimmablesize - the amount of elements that should be allowedpublic void forEach(ShortConsumer action)
ShortIterableforEach in interface ShortIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public void forEachIndexed(IntShortConsumer action)
ShortIterableforEachIndexed in interface ShortIterableaction - The action to be performed for each elementpublic <E> void forEach(E input,
ObjectShortConsumer<E> action)
ShortIterableforEach in interface ShortIterableE - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementpublic boolean matchesAny(ShortPredicate filter)
ShortIterablematchesAny in interface ShortIterablefilter - that should be appliedpublic boolean matchesNone(ShortPredicate filter)
ShortIterablematchesNone in interface ShortIterablefilter - that should be appliedpublic boolean matchesAll(ShortPredicate filter)
ShortIterablematchesAll in interface ShortIterablefilter - that should be appliedpublic short reduce(short identity,
ShortShortUnaryOperator operator)
ShortIterablereduce in interface ShortIterableidentity - the start valueoperator - the operation that should be appliedpublic short reduce(ShortShortUnaryOperator operator)
ShortIterablereduce in interface ShortIterableoperator - the operation that should be appliedpublic short findFirst(ShortPredicate filter)
ShortIterablefindFirst in interface ShortIterablefilter - that should be appliedpublic int count(ShortPredicate filter)
ShortIterablecount in interface ShortIterablefilter - that should be appliedpublic ShortIterator iterator()
ShortCollectioniterator in interface java.lang.Iterable<java.lang.Short>iterator in interface java.util.Collection<java.lang.Short>iterator in interface java.util.Set<java.lang.Short>iterator in interface ShortCollectioniterator in interface ShortIterableiterator in interface ShortSetiterator in class AbstractShortSetCollection.iterator()public ShortOpenHashSet copy()
ShortCollectioncopy in interface ShortCollectioncopy in interface ShortSetcopy in class AbstractShortSetpublic void clear()
clear in interface java.util.Collection<java.lang.Short>clear in interface java.util.Set<java.lang.Short>clear in class java.util.AbstractCollection<java.lang.Short>public int size()
size in interface java.util.Collection<java.lang.Short>size in interface java.util.Set<java.lang.Short>size in interface ISizeProvidersize in class java.util.AbstractCollection<java.lang.Short>