public class ByteOpenCustomHashSet extends AbstractByteSet implements ITrimmable
ISizeProvider.CollectionSize| Constructor and Description |
|---|
ByteOpenCustomHashSet(byte[] array,
ByteStrategy strategy)
Helper constructor that allow to create a set from unboxed values
|
ByteOpenCustomHashSet(byte[] array,
float loadFactor,
ByteStrategy strategy)
Helper constructor that allow to create a set from unboxed values
|
ByteOpenCustomHashSet(byte[] array,
int offset,
int length,
ByteStrategy strategy)
Helper constructor that allow to create a set from unboxed values
|
ByteOpenCustomHashSet(byte[] array,
int offset,
int length,
float loadFactor,
ByteStrategy strategy)
Helper constructor that allow to create a set from unboxed values
|
ByteOpenCustomHashSet(ByteCollection collection,
ByteStrategy strategy)
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
|
ByteOpenCustomHashSet(ByteCollection collection,
float loadFactor,
ByteStrategy strategy)
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
|
ByteOpenCustomHashSet(ByteIterator iterator,
ByteStrategy strategy)
A Helper constructor that allows to create a set from a iterator of an unknown size
|
ByteOpenCustomHashSet(ByteIterator iterator,
float loadFactor,
ByteStrategy strategy)
A Helper constructor that allows to create a set from a iterator of an unknown size
|
ByteOpenCustomHashSet(ByteStrategy strategy)
Default Contstructor
|
ByteOpenCustomHashSet(java.util.Collection<? extends java.lang.Byte> collection,
ByteStrategy strategy)
Deprecated.
|
ByteOpenCustomHashSet(java.util.Collection<? extends java.lang.Byte> collection,
float loadFactor,
ByteStrategy strategy)
Deprecated.
|
ByteOpenCustomHashSet(int minCapacity,
ByteStrategy strategy)
Constructor that defines the minimum capacity
|
ByteOpenCustomHashSet(int minCapacity,
float loadFactor,
ByteStrategy strategy)
Constructor that defines the minimum capacity and load factor
|
ByteOpenCustomHashSet(java.util.Iterator<java.lang.Byte> iterator,
ByteStrategy strategy)
A Helper constructor that allows to create a set from a iterator of an unknown size
|
ByteOpenCustomHashSet(java.util.Iterator<java.lang.Byte> iterator,
float loadFactor,
ByteStrategy strategy)
A Helper constructor that allows to create a set from a iterator of an unknown size
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(byte o)
A Type-Specific add function to reduce (un)boxing
|
boolean |
addAll(ByteCollection c)
A Type-Specific addAll function to reduce (un)boxing
|
boolean |
addAll(java.util.Collection<? extends java.lang.Byte> c)
Deprecated.
|
void |
clear() |
void |
clearAndTrim(int size)
Trims the collection down to the requested size and clears all elements while doing so
|
boolean |
contains(byte o)
A Type-Specific implementation of contains.
|
ByteOpenCustomHashSet |
copy()
A Function that does a shallow clone of the Collection itself.
|
int |
count(BytePredicate filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
byte |
findFirst(BytePredicate filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
void |
forEach(ByteConsumer action)
A Type Specific foreach function that reduces (un)boxing
|
<E> void |
forEach(E input,
ObjectByteConsumer<E> action)
Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
|
void |
forEachIndexed(IntByteConsumer action)
A Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.
|
ByteStrategy |
getStrategy()
Helper getter function to get the current strategy
|
ByteIterator |
iterator()
Returns a Type-Specific Iterator to reduce (un)boxing
|
boolean |
matchesAll(BytePredicate filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(BytePredicate filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(BytePredicate filter)
Helper function to reduce stream usage that allows to filter for no matches.
|
byte |
reduce(byte identity,
ByteByteUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
byte |
reduce(ByteByteUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
boolean |
remove(byte 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, contains, containsAll, containsAll, containsAny, containsAny, remByte, remove, removeAll, removeAll, retainAll, retainAll, toByteArray, toByteArrayisEmpty, removeAll, retainAll, toArray, toArray, toStringclearAndTrim, trimadd, contains, remByte, remove, spliterator, synchronize, synchronize, unmodifiablecontainsAll, isEmpty, removeAll, retainAll, toArray, toArrayaddAll, addAll, addAll, containsAll, containsAny, containsAny, parallelPrimitiveStream, pour, primitiveStream, remIf, removeAll, removeAll, removeIf, retainAll, retainAll, toByteArray, toByteArrayarrayflatMap, asAsync, distinct, filter, flatMap, forEach, limit, map, peek, pourAsList, pourAsSet, repeat, sortedofpublic ByteOpenCustomHashSet(ByteStrategy strategy)
strategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic ByteOpenCustomHashSet(int minCapacity,
ByteStrategy strategy)
minCapacity - the minimum capacity the HashSet is allowed to be.strategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the minimum capacity is negativepublic ByteOpenCustomHashSet(int minCapacity,
float loadFactor,
ByteStrategy strategy)
minCapacity - the minimum capacity the HashSet is allowed to be.loadFactor - the percentage of how full the backing array can be before they resizestrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the minimum capacity is negativejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public ByteOpenCustomHashSet(byte[] array,
ByteStrategy strategy)
array - the elements that should be put into the setstrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic ByteOpenCustomHashSet(byte[] array,
float loadFactor,
ByteStrategy strategy)
array - the elements that should be put into the setloadFactor - the percentage of how full the backing array can be before they resizestrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public ByteOpenCustomHashSet(byte[] array,
int offset,
int length,
ByteStrategy strategy)
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 arraystrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if offset and length causes to step outside of the arrays rangepublic ByteOpenCustomHashSet(byte[] array,
int offset,
int length,
float loadFactor,
ByteStrategy strategy)
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 resizestrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nulljava.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 ByteOpenCustomHashSet(java.util.Collection<? extends java.lang.Byte> collection,
ByteStrategy strategy)
collection - the set the elements should be added to the Setstrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is null@Deprecated
public ByteOpenCustomHashSet(java.util.Collection<? extends java.lang.Byte> collection,
float loadFactor,
ByteStrategy strategy)
collection - the set the elements should be added to the SetloadFactor - the percentage of how full the backing array can be before they resizestrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public ByteOpenCustomHashSet(ByteCollection collection, ByteStrategy strategy)
collection - the set the elements should be added to the Setstrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic ByteOpenCustomHashSet(ByteCollection collection, float loadFactor, ByteStrategy strategy)
collection - the set the elements should be added to the SetloadFactor - the percentage of how full the backing array can be before they resizestrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public ByteOpenCustomHashSet(java.util.Iterator<java.lang.Byte> iterator,
ByteStrategy strategy)
iterator - the elements that should be added to the setstrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic ByteOpenCustomHashSet(java.util.Iterator<java.lang.Byte> iterator,
float loadFactor,
ByteStrategy strategy)
iterator - the elements that should be added to the setloadFactor - the percentage of how full the backing array can be before they resizestrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public ByteOpenCustomHashSet(ByteIterator iterator, ByteStrategy strategy)
iterator - the elements that should be added to the setstrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic ByteOpenCustomHashSet(ByteIterator iterator, float loadFactor, ByteStrategy strategy)
iterator - the elements that should be added to the setloadFactor - the percentage of how full the backing array can be before they resizestrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public ByteStrategy getStrategy()
public boolean add(byte o)
ByteCollectionadd in interface ByteCollectiono - the element that should be added@Deprecated public boolean addAll(java.util.Collection<? extends java.lang.Byte> c)
AbstractByteCollectionThis default implementation delegates to the corresponding type-specific function.
addAll in interface java.util.Collection<java.lang.Byte>addAll in interface java.util.Set<java.lang.Byte>addAll in class AbstractByteCollectionpublic boolean addAll(ByteCollection c)
ByteCollectionaddAll in interface ByteCollectionaddAll in class AbstractByteCollectionc - the collection of elements that should be addedpublic boolean contains(byte o)
AbstractByteCollectioncontains in interface ByteCollectioncontains in class AbstractByteCollectiono - the element that should be searched for.public boolean remove(byte o)
ByteSetpublic 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 ByteIterator iterator()
ByteCollectioniterator in interface java.lang.Iterable<java.lang.Byte>iterator in interface java.util.Collection<java.lang.Byte>iterator in interface java.util.Set<java.lang.Byte>iterator in interface ByteCollectioniterator in interface ByteIterableiterator in interface ByteSetiterator in class AbstractByteSetCollection.iterator()public ByteOpenCustomHashSet copy()
ByteCollectioncopy in interface ByteCollectioncopy in interface ByteSetcopy in class AbstractByteSetpublic void clear()
clear in interface java.util.Collection<java.lang.Byte>clear in interface java.util.Set<java.lang.Byte>clear in class java.util.AbstractCollection<java.lang.Byte>public int size()
size in interface java.util.Collection<java.lang.Byte>size in interface java.util.Set<java.lang.Byte>size in interface ISizeProvidersize in class java.util.AbstractCollection<java.lang.Byte>public void forEach(ByteConsumer action)
ByteIterableforEach in interface ByteIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public void forEachIndexed(IntByteConsumer action)
ByteIterableforEachIndexed in interface ByteIterableaction - The action to be performed for each elementpublic <E> void forEach(E input,
ObjectByteConsumer<E> action)
ByteIterableforEach in interface ByteIterableE - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementpublic boolean matchesAny(BytePredicate filter)
ByteIterablematchesAny in interface ByteIterablefilter - that should be appliedpublic boolean matchesNone(BytePredicate filter)
ByteIterablematchesNone in interface ByteIterablefilter - that should be appliedpublic boolean matchesAll(BytePredicate filter)
ByteIterablematchesAll in interface ByteIterablefilter - that should be appliedpublic byte reduce(byte identity,
ByteByteUnaryOperator operator)
ByteIterablereduce in interface ByteIterableidentity - the start valueoperator - the operation that should be appliedpublic byte reduce(ByteByteUnaryOperator operator)
ByteIterablereduce in interface ByteIterableoperator - the operation that should be appliedpublic byte findFirst(BytePredicate filter)
ByteIterablefindFirst in interface ByteIterablefilter - that should be appliedpublic int count(BytePredicate filter)
ByteIterablecount in interface ByteIterablefilter - that should be applied