Modul speiger.src.collections
Klasse ByteLinkedOpenHashSet
java.lang.Object
java.util.AbstractCollection<Byte>
speiger.src.collections.bytes.collections.AbstractByteCollection
speiger.src.collections.bytes.sets.AbstractByteSet
speiger.src.collections.bytes.sets.ByteOpenHashSet
speiger.src.collections.bytes.sets.ByteLinkedOpenHashSet
- Alle implementierten Schnittstellen:
Iterable<Byte>,Collection<Byte>,Set<Byte>,ByteCollection,ByteIterable,ByteOrderedSet,ByteSet,ISizeProvider,ITrimmable
A Type Specific LinkedHashMap implementation that uses specific arrays to create links between nodes to remove the wrapping of elements
to greatly reduce memory usage. In Addition adding some helper methods to move around elements.
This implementation of SortedSet does not support SubSet of any kind. It implements the interface due to sortability and first/last access
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen speiger.src.collections.utils.ISizeProvider
ISizeProvider.CollectionSize -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungDefault ConstructorByteLinkedOpenHashSet(byte[] array) Helper constructor that allow to create a set from unboxed valuesByteLinkedOpenHashSet(byte[] array, float loadFactor) Helper constructor that allow to create a set from unboxed valuesByteLinkedOpenHashSet(byte[] array, int offset, int length) Helper constructor that allow to create a set from unboxed valuesByteLinkedOpenHashSet(byte[] array, int offset, int length, float loadFactor) Helper constructor that allow to create a set from unboxed valuesByteLinkedOpenHashSet(int minCapacity) Constructor that defines the minimum capacityByteLinkedOpenHashSet(int minCapacity, float loadFactor) Constructor that defines the minimum capacity and load factorByteLinkedOpenHashSet(Collection<? extends Byte> collection) Veraltet.ByteLinkedOpenHashSet(Collection<? extends Byte> collection, float loadFactor) Veraltet.ByteLinkedOpenHashSet(Iterator<Byte> iterator) A Helper constructor that allows to create a set from a iterator of an unknown sizeByteLinkedOpenHashSet(Iterator<Byte> iterator, float loadFactor) A Helper constructor that allows to create a set from a iterator of an unknown sizeByteLinkedOpenHashSet(ByteCollection collection) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.ByteLinkedOpenHashSet(ByteCollection collection, float loadFactor) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.ByteLinkedOpenHashSet(ByteIterator iterator) A Helper constructor that allows to create a set from a iterator of an unknown sizeByteLinkedOpenHashSet(ByteIterator iterator, float loadFactor) A Helper constructor that allows to create a set from a iterator of an unknown size -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanaddAndMoveToFirst(byte o) A customized add method that allows you to insert into the first index.booleanaddAndMoveToLast(byte o) A customized add method that allows you to insert into the last index.voidclear()voidclearAndTrim(int size) Trims the collection down to the requested size and clears all elements while doing socopy()A Function that does a shallow clone of the Collection itself.intcount(BytePredicate filter) Helper function to reduce stream usage that allows to count the valid elements.bytefindFirst(BytePredicate filter) Helper function to reduce stream usage that allows to filter for the first match.byteA method to get the first element in the set<E> voidforEach(E input, ObjectByteConsumer<E> action) Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.voidforEach(ByteConsumer action) A Type Specific foreach function that reduces (un)boxingvoidforEachIndexed(IntByteConsumer action) A Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.iterator()Returns a Type-Specific Iterator to reduce (un)boxingiterator(byte fromElement) A type Specific Iterator starting from a given keybytelastByte()A method to get the last element in the setbooleanmatchesAll(BytePredicate filter) Helper function to reduce stream usage that allows to filter for all matches.booleanmatchesAny(BytePredicate filter) Helper function to reduce stream usage that allows to filter for any matches.booleanmatchesNone(BytePredicate filter) Helper function to reduce stream usage that allows to filter for no matches.booleanmoveToFirst(byte o) A specific move method to move a given key to the first index.booleanmoveToLast(byte o) A specific move method to move a given key to the last index.byteA method to get and remove the first element in the setbyteA method to get and remove the last element in the setbytereduce(byte identity, ByteByteUnaryOperator operator) Performs a reduction on the elements of this Iterablebytereduce(ByteByteUnaryOperator operator) Performs a reduction on the elements of this IterableObject[]toArray()Veraltet.<E> E[]toArray(E[] a) Veraltet.byte[]toByteArray(byte[] a) A Type-Specific implementation of toArray.Von Klasse geerbte Methoden speiger.src.collections.bytes.sets.ByteOpenHashSet
add, addAll, addAll, contains, contains, remove, remove, size, trimVon Klasse geerbte Methoden speiger.src.collections.bytes.sets.AbstractByteSet
equals, hashCodeVon Klasse geerbte Methoden speiger.src.collections.bytes.collections.AbstractByteCollection
add, containsAll, containsAll, containsAny, containsAny, remByte, removeAll, removeAll, retainAll, retainAll, toByteArrayVon Klasse geerbte Methoden java.util.AbstractCollection
isEmpty, removeAll, retainAll, toStringVon Schnittstelle geerbte Methoden speiger.src.collections.bytes.collections.ByteCollection
add, addAll, addAll, addAll, addAll, contains, containsAll, containsAny, containsAny, parallelPrimitiveStream, pour, primitiveStream, remIf, removeAll, removeAll, removeIf, retainAll, retainAll, spliterator, toByteArrayVon Schnittstelle geerbte Methoden speiger.src.collections.bytes.collections.ByteIterable
arrayflatMap, asAsync, distinct, filter, flatMap, forEach, limit, map, peek, pourAsList, pourAsSet, repeat, sortedVon Schnittstelle geerbte Methoden speiger.src.collections.bytes.sets.ByteOrderedSet
spliterator, synchronize, synchronize, unmodifiableVon Schnittstelle geerbte Methoden speiger.src.collections.bytes.sets.ByteSet
add, contains, remByte, remove, removeVon Schnittstelle geerbte Methoden java.util.Collection
parallelStream, stream, toArrayVon Schnittstelle geerbte Methoden speiger.src.collections.utils.ISizeProvider
sizeVon Schnittstelle geerbte Methoden speiger.src.collections.utils.ITrimmable
clearAndTrim, trim
-
Konstruktordetails
-
ByteLinkedOpenHashSet
public ByteLinkedOpenHashSet()Default Constructor -
ByteLinkedOpenHashSet
public ByteLinkedOpenHashSet(int minCapacity) Constructor that defines the minimum capacity- Parameter:
minCapacity- the minimum capacity the HashSet is allowed to be.- Löst aus:
IllegalStateException- if the minimum capacity is negative
-
ByteLinkedOpenHashSet
public ByteLinkedOpenHashSet(int minCapacity, float loadFactor) Constructor that defines the minimum capacity and load factor- Parameter:
minCapacity- the minimum capacity the HashSet is allowed to be.loadFactor- the percentage of how full the backing array can be before they resize- Löst aus:
IllegalStateException- if the minimum capacity is negativeIllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
ByteLinkedOpenHashSet
public ByteLinkedOpenHashSet(byte[] array) Helper constructor that allow to create a set from unboxed values- Parameter:
array- the elements that should be put into the set
-
ByteLinkedOpenHashSet
public ByteLinkedOpenHashSet(byte[] array, float loadFactor) Helper constructor that allow to create a set from unboxed values- Parameter:
array- the elements that should be put into the setloadFactor- the percentage of how full the backing array can be before they resize- Löst aus:
IllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
ByteLinkedOpenHashSet
public ByteLinkedOpenHashSet(byte[] array, int offset, int length) Helper constructor that allow to create a set from unboxed values- Parameter:
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 array- Löst aus:
IllegalStateException- if offset and length causes to step outside of the arrays range
-
ByteLinkedOpenHashSet
public ByteLinkedOpenHashSet(byte[] array, int offset, int length, float loadFactor) Helper constructor that allow to create a set from unboxed values- Parameter:
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 resize- Löst aus:
IllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1IllegalStateException- if offset and length causes to step outside of the arrays range
-
ByteLinkedOpenHashSet
Veraltet.A Helper constructor that allows to create a Set with exactly the same values as the provided collection.- Parameter:
collection- the set the elements should be added to the Set
-
ByteLinkedOpenHashSet
Veraltet.A Helper constructor that allows to create a Set with exactly the same values as the provided collection.- Parameter:
collection- the set the elements should be added to the SetloadFactor- the percentage of how full the backing array can be before they resize- Löst aus:
IllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
ByteLinkedOpenHashSet
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.- Parameter:
collection- the set the elements should be added to the Set
-
ByteLinkedOpenHashSet
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.- Parameter:
collection- the set the elements should be added to the SetloadFactor- the percentage of how full the backing array can be before they resize- Löst aus:
IllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
ByteLinkedOpenHashSet
A Helper constructor that allows to create a set from a iterator of an unknown size- Parameter:
iterator- the elements that should be added to the set
-
ByteLinkedOpenHashSet
A Helper constructor that allows to create a set from a iterator of an unknown size- Parameter:
iterator- the elements that should be added to the setloadFactor- the percentage of how full the backing array can be before they resize- Löst aus:
IllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
ByteLinkedOpenHashSet
A Helper constructor that allows to create a set from a iterator of an unknown size- Parameter:
iterator- the elements that should be added to the set
-
ByteLinkedOpenHashSet
A Helper constructor that allows to create a set from a iterator of an unknown size- Parameter:
iterator- the elements that should be added to the setloadFactor- the percentage of how full the backing array can be before they resize- Löst aus:
IllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
-
Methodendetails
-
addAndMoveToFirst
public boolean addAndMoveToFirst(byte o) Beschreibung aus Schnittstelle kopiert:ByteOrderedSetA customized add method that allows you to insert into the first index.- Angegeben von:
addAndMoveToFirstin SchnittstelleByteOrderedSet- Parameter:
o- the element that should be inserted- Gibt zurück:
- true if it was added
- Siehe auch:
-
addAndMoveToLast
public boolean addAndMoveToLast(byte o) Beschreibung aus Schnittstelle kopiert:ByteOrderedSetA customized add method that allows you to insert into the last index.- Angegeben von:
addAndMoveToLastin SchnittstelleByteOrderedSet- Parameter:
o- the element that should be inserted- Gibt zurück:
- true if it was added
- Siehe auch:
-
moveToFirst
public boolean moveToFirst(byte o) Beschreibung aus Schnittstelle kopiert:ByteOrderedSetA specific move method to move a given key to the first index.- Angegeben von:
moveToFirstin SchnittstelleByteOrderedSet- Parameter:
o- that should be moved to the first index- Gibt zurück:
- true if the value was moved.
-
moveToLast
public boolean moveToLast(byte o) Beschreibung aus Schnittstelle kopiert:ByteOrderedSetA specific move method to move a given key to the last index.- Angegeben von:
moveToLastin SchnittstelleByteOrderedSet- Parameter:
o- that should be moved to the first last- Gibt zurück:
- true if the value was moved.
-
firstByte
public byte firstByte()Beschreibung aus Schnittstelle kopiert:ByteOrderedSetA method to get the first element in the set- Angegeben von:
firstBytein SchnittstelleByteOrderedSet- Gibt zurück:
- first element in the set
-
pollFirstByte
public byte pollFirstByte()Beschreibung aus Schnittstelle kopiert:ByteOrderedSetA method to get and remove the first element in the set- Angegeben von:
pollFirstBytein SchnittstelleByteOrderedSet- Gibt zurück:
- first element in the set
-
lastByte
public byte lastByte()Beschreibung aus Schnittstelle kopiert:ByteOrderedSetA method to get the last element in the set- Angegeben von:
lastBytein SchnittstelleByteOrderedSet- Gibt zurück:
- last element in the set
-
pollLastByte
public byte pollLastByte()Beschreibung aus Schnittstelle kopiert:ByteOrderedSetA method to get and remove the last element in the set- Angegeben von:
pollLastBytein SchnittstelleByteOrderedSet- Gibt zurück:
- last element in the set
-
toByteArray
public byte[] toByteArray(byte[] a) Beschreibung aus Klasse kopiert:AbstractByteCollectionA Type-Specific implementation of toArray. This implementation iterates over all elements and unwraps them into primitive type.- Angegeben von:
toByteArrayin SchnittstelleByteCollection- Setzt außer Kraft:
toByteArrayin KlasseByteOpenHashSet- Parameter:
a- array that the elements should be injected to. If null or to small a new array with the right size is created- Gibt zurück:
- an array containing all of the elements in this collection
- Siehe auch:
-
toArray
Veraltet.- Angegeben von:
toArrayin SchnittstelleCollection<Byte>- Angegeben von:
toArrayin SchnittstelleSet<Byte>- Setzt außer Kraft:
toArrayin KlasseByteOpenHashSet
-
toArray
Veraltet.- Angegeben von:
toArrayin SchnittstelleCollection<Byte>- Angegeben von:
toArrayin SchnittstelleSet<Byte>- Setzt außer Kraft:
toArrayin KlasseByteOpenHashSet
-
forEach
Beschreibung aus Schnittstelle kopiert:ByteIterableA Type Specific foreach function that reduces (un)boxing- Angegeben von:
forEachin SchnittstelleByteIterable- Setzt außer Kraft:
forEachin KlasseByteOpenHashSet- Parameter:
action- The action to be performed for each element- Siehe auch:
-
forEachIndexed
Beschreibung aus Schnittstelle kopiert:ByteIterableA Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.- Angegeben von:
forEachIndexedin SchnittstelleByteIterable- Setzt außer Kraft:
forEachIndexedin KlasseByteOpenHashSet- Parameter:
action- The action to be performed for each element
-
forEach
Beschreibung aus Schnittstelle kopiert:ByteIterableHelper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.- Angegeben von:
forEachin SchnittstelleByteIterable- Setzt außer Kraft:
forEachin KlasseByteOpenHashSet- Typparameter:
E- the generic type of the Object- Parameter:
input- the object that should be includedaction- The action to be performed for each element
-
matchesAny
Beschreibung aus Schnittstelle kopiert:ByteIterableHelper function to reduce stream usage that allows to filter for any matches.- Angegeben von:
matchesAnyin SchnittstelleByteIterable- Setzt außer Kraft:
matchesAnyin KlasseByteOpenHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- true if any matches were found
-
matchesNone
Beschreibung aus Schnittstelle kopiert:ByteIterableHelper function to reduce stream usage that allows to filter for no matches.- Angegeben von:
matchesNonein SchnittstelleByteIterable- Setzt außer Kraft:
matchesNonein KlasseByteOpenHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- true if no matches were found
-
matchesAll
Beschreibung aus Schnittstelle kopiert:ByteIterableHelper function to reduce stream usage that allows to filter for all matches.- Angegeben von:
matchesAllin SchnittstelleByteIterable- Setzt außer Kraft:
matchesAllin KlasseByteOpenHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- true if all matches.
-
reduce
Beschreibung aus Schnittstelle kopiert:ByteIterablePerforms a reduction on the elements of this Iterable- Angegeben von:
reducein SchnittstelleByteIterable- Setzt außer Kraft:
reducein KlasseByteOpenHashSet- Parameter:
identity- the start valueoperator- the operation that should be applied- Gibt zurück:
- the reduction result, returns identity if nothing was found
-
reduce
Beschreibung aus Schnittstelle kopiert:ByteIterablePerforms a reduction on the elements of this Iterable- Angegeben von:
reducein SchnittstelleByteIterable- Setzt außer Kraft:
reducein KlasseByteOpenHashSet- Parameter:
operator- the operation that should be applied- Gibt zurück:
- the reduction result, returns null value if nothing was found
-
findFirst
Beschreibung aus Schnittstelle kopiert:ByteIterableHelper function to reduce stream usage that allows to filter for the first match.- Angegeben von:
findFirstin SchnittstelleByteIterable- Setzt außer Kraft:
findFirstin KlasseByteOpenHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- the found value or the null equivalent variant.
-
count
Beschreibung aus Schnittstelle kopiert:ByteIterableHelper function to reduce stream usage that allows to count the valid elements.- Angegeben von:
countin SchnittstelleByteIterable- Setzt außer Kraft:
countin KlasseByteOpenHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- the amount of Valid Elements
-
clear
public void clear()- Angegeben von:
clearin SchnittstelleCollection<Byte>- Angegeben von:
clearin SchnittstelleSet<Byte>- Setzt außer Kraft:
clearin KlasseByteOpenHashSet
-
clearAndTrim
public void clearAndTrim(int size) Beschreibung aus Schnittstelle kopiert:ITrimmableTrims the collection down to the requested size and clears all elements while doing so- Angegeben von:
clearAndTrimin SchnittstelleITrimmable- Setzt außer Kraft:
clearAndTrimin KlasseByteOpenHashSet- Parameter:
size- the amount of elements that should be allowed
-
iterator
Beschreibung aus Schnittstelle kopiert:ByteCollectionReturns a Type-Specific Iterator to reduce (un)boxing- Angegeben von:
iteratorin SchnittstelleByteCollection- Angegeben von:
iteratorin SchnittstelleByteIterable- Angegeben von:
iteratorin SchnittstelleByteOrderedSet- Angegeben von:
iteratorin SchnittstelleByteSet- Angegeben von:
iteratorin SchnittstelleCollection<Byte>- Angegeben von:
iteratorin SchnittstelleIterable<Byte>- Angegeben von:
iteratorin SchnittstelleSet<Byte>- Setzt außer Kraft:
iteratorin KlasseByteOpenHashSet- Gibt zurück:
- a iterator of the collection
- Siehe auch:
-
iterator
Beschreibung aus Schnittstelle kopiert:ByteOrderedSetA type Specific Iterator starting from a given key- Angegeben von:
iteratorin SchnittstelleByteOrderedSet- Parameter:
fromElement- the element the iterator should start from- Gibt zurück:
- a iterator starting from the given element
-
copy
Beschreibung aus Schnittstelle kopiert:ByteCollectionA Function that does a shallow clone of the Collection itself. This function is more optimized then a copy constructor since the Collection does not have to be unsorted/resorted. It can be compared to Cloneable but with less exception risk- Angegeben von:
copyin SchnittstelleByteCollection- Angegeben von:
copyin SchnittstelleByteOrderedSet- Angegeben von:
copyin SchnittstelleByteSet- Setzt außer Kraft:
copyin KlasseByteOpenHashSet- Gibt zurück:
- a Shallow Copy of the collection
-