Modul speiger.src.collections
Klasse ShortLinkedOpenCustomHashSet
java.lang.Object
java.util.AbstractCollection<Short>
speiger.src.collections.shorts.collections.AbstractShortCollection
speiger.src.collections.shorts.sets.AbstractShortSet
speiger.src.collections.shorts.sets.ShortOpenCustomHashSet
speiger.src.collections.shorts.sets.ShortLinkedOpenCustomHashSet
- Alle implementierten Schnittstellen:
Iterable<Short>,Collection<Short>,Set<Short>,ShortCollection,ShortIterable,ShortOrderedSet,ShortSet,ISizeProvider,ITrimmable
A Type Specific LinkedHashSet that allows for custom HashControl. That uses arrays to create links between nodes.
For cases where Objects/primitive do not allow hashcoding this can be really useful and provide a lot of control.
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
KonstruktorenKonstruktorBeschreibungShortLinkedOpenCustomHashSet(int minCapacity, float loadFactor, ShortStrategy strategy) Constructor that defines the minimum capacity and load factorShortLinkedOpenCustomHashSet(int minCapacity, ShortStrategy strategy) Constructor that defines the minimum capacityShortLinkedOpenCustomHashSet(short[] array, float loadFactor, ShortStrategy strategy) Helper constructor that allow to create a set from unboxed valuesShortLinkedOpenCustomHashSet(short[] array, int offset, int length, float loadFactor, ShortStrategy strategy) Helper constructor that allow to create a set from unboxed valuesShortLinkedOpenCustomHashSet(short[] array, int offset, int length, ShortStrategy strategy) Helper constructor that allow to create a set from unboxed valuesShortLinkedOpenCustomHashSet(short[] array, ShortStrategy strategy) Helper constructor that allow to create a set from unboxed valuesShortLinkedOpenCustomHashSet(Collection<? extends Short> collection, float loadFactor, ShortStrategy strategy) Veraltet.ShortLinkedOpenCustomHashSet(Collection<? extends Short> collection, ShortStrategy strategy) Veraltet.ShortLinkedOpenCustomHashSet(Iterator<Short> iterator, float loadFactor, ShortStrategy strategy) A Helper constructor that allows to create a set from a iterator of an unknown sizeShortLinkedOpenCustomHashSet(Iterator<Short> iterator, ShortStrategy strategy) A Helper constructor that allows to create a set from a iterator of an unknown sizeShortLinkedOpenCustomHashSet(ShortCollection collection, float loadFactor, ShortStrategy strategy) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.ShortLinkedOpenCustomHashSet(ShortCollection collection, ShortStrategy strategy) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.ShortLinkedOpenCustomHashSet(ShortIterator iterator, float loadFactor, ShortStrategy strategy) A Helper constructor that allows to create a set from a iterator of an unknown sizeShortLinkedOpenCustomHashSet(ShortIterator iterator, ShortStrategy strategy) A Helper constructor that allows to create a set from a iterator of an unknown sizeShortLinkedOpenCustomHashSet(ShortStrategy strategy) Default Contstructor -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanaddAndMoveToFirst(short o) A customized add method that allows you to insert into the first index.booleanaddAndMoveToLast(short 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(ShortPredicate filter) Helper function to reduce stream usage that allows to count the valid elements.shortfindFirst(ShortPredicate filter) Helper function to reduce stream usage that allows to filter for the first match.shortA method to get the first element in the set<E> voidforEach(E input, ObjectShortConsumer<E> action) Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.voidforEach(ShortConsumer action) A Type Specific foreach function that reduces (un)boxingvoidforEachIndexed(IntShortConsumer 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(short fromElement) A type Specific Iterator starting from a given keyshortA method to get the last element in the setbooleanmatchesAll(ShortPredicate filter) Helper function to reduce stream usage that allows to filter for all matches.booleanmatchesAny(ShortPredicate filter) Helper function to reduce stream usage that allows to filter for any matches.booleanmatchesNone(ShortPredicate filter) Helper function to reduce stream usage that allows to filter for no matches.booleanmoveToFirst(short o) A specific move method to move a given key to the first index.booleanmoveToLast(short o) A specific move method to move a given key to the last index.shortA method to get and remove the first element in the setshortA method to get and remove the last element in the setshortreduce(short identity, ShortShortUnaryOperator operator) Performs a reduction on the elements of this Iterableshortreduce(ShortShortUnaryOperator operator) Performs a reduction on the elements of this IterableObject[]toArray()Veraltet.<E> E[]toArray(E[] a) Veraltet.short[]toShortArray(short[] a) A Type-Specific implementation of toArray.Von Klasse geerbte Methoden speiger.src.collections.shorts.sets.ShortOpenCustomHashSet
add, addAll, addAll, contains, getStrategy, remove, size, trimVon Klasse geerbte Methoden speiger.src.collections.shorts.sets.AbstractShortSet
equals, hashCodeVon Klasse geerbte Methoden speiger.src.collections.shorts.collections.AbstractShortCollection
add, contains, containsAll, containsAll, containsAny, containsAny, remove, removeAll, removeAll, remShort, retainAll, retainAll, toShortArrayVon Klasse geerbte Methoden java.util.AbstractCollection
isEmpty, removeAll, retainAll, toStringVon 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, trimVon Schnittstelle geerbte Methoden java.util.Set
addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, sizeVon Schnittstelle geerbte Methoden speiger.src.collections.shorts.collections.ShortCollection
add, addAll, addAll, addAll, addAll, contains, containsAll, containsAny, containsAny, parallelPrimitiveStream, pour, primitiveStream, remIf, removeAll, removeAll, removeIf, retainAll, retainAll, spliterator, toShortArrayVon Schnittstelle geerbte Methoden speiger.src.collections.shorts.collections.ShortIterable
arrayflatMap, asAsync, distinct, filter, flatMap, forEach, limit, map, peek, pourAsList, pourAsSet, repeat, sortedVon Schnittstelle geerbte Methoden speiger.src.collections.shorts.sets.ShortOrderedSet
spliterator, synchronize, synchronize, unmodifiable
-
Konstruktordetails
-
ShortLinkedOpenCustomHashSet
Default Contstructor- Parameter:
strategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is null
-
ShortLinkedOpenCustomHashSet
Constructor that defines the minimum capacity- Parameter:
minCapacity- the minimum capacity the HashSet is allowed to be.strategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is nullIllegalStateException- if the minimum capacity is negative
-
ShortLinkedOpenCustomHashSet
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 resizestrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is nullIllegalStateException- if the minimum capacity is negativeIllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
ShortLinkedOpenCustomHashSet
Helper constructor that allow to create a set from unboxed values- Parameter:
array- the elements that should be put into the setstrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is null
-
ShortLinkedOpenCustomHashSet
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 resizestrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is nullIllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
ShortLinkedOpenCustomHashSet
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 arraystrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is nullIllegalStateException- if offset and length causes to step outside of the arrays range
-
ShortLinkedOpenCustomHashSet
public ShortLinkedOpenCustomHashSet(short[] array, int offset, int length, float loadFactor, ShortStrategy strategy) 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 resizestrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is nullIllegalStateException- 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
-
ShortLinkedOpenCustomHashSet
@Deprecated public ShortLinkedOpenCustomHashSet(Collection<? extends Short> collection, ShortStrategy strategy) 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 Setstrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is null
-
ShortLinkedOpenCustomHashSet
@Deprecated public ShortLinkedOpenCustomHashSet(Collection<? extends Short> collection, float loadFactor, ShortStrategy strategy) 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 resizestrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is nullIllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
ShortLinkedOpenCustomHashSet
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 Setstrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is null
-
ShortLinkedOpenCustomHashSet
public ShortLinkedOpenCustomHashSet(ShortCollection collection, float loadFactor, ShortStrategy strategy) 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 resizestrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is nullIllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
ShortLinkedOpenCustomHashSet
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 setstrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is null
-
ShortLinkedOpenCustomHashSet
public ShortLinkedOpenCustomHashSet(Iterator<Short> iterator, float loadFactor, ShortStrategy strategy) 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 resizestrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is nullIllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
ShortLinkedOpenCustomHashSet
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 setstrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is null
-
ShortLinkedOpenCustomHashSet
public ShortLinkedOpenCustomHashSet(ShortIterator iterator, float loadFactor, ShortStrategy strategy) 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 resizestrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is nullIllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
-
Methodendetails
-
addAndMoveToFirst
public boolean addAndMoveToFirst(short o) Beschreibung aus Schnittstelle kopiert:ShortOrderedSetA customized add method that allows you to insert into the first index.- Angegeben von:
addAndMoveToFirstin SchnittstelleShortOrderedSet- Parameter:
o- the element that should be inserted- Gibt zurück:
- true if it was added
- Siehe auch:
-
addAndMoveToLast
public boolean addAndMoveToLast(short o) Beschreibung aus Schnittstelle kopiert:ShortOrderedSetA customized add method that allows you to insert into the last index.- Angegeben von:
addAndMoveToLastin SchnittstelleShortOrderedSet- Parameter:
o- the element that should be inserted- Gibt zurück:
- true if it was added
- Siehe auch:
-
moveToFirst
public boolean moveToFirst(short o) Beschreibung aus Schnittstelle kopiert:ShortOrderedSetA specific move method to move a given key to the first index.- Angegeben von:
moveToFirstin SchnittstelleShortOrderedSet- Parameter:
o- that should be moved to the first index- Gibt zurück:
- true if the value was moved.
-
moveToLast
public boolean moveToLast(short o) Beschreibung aus Schnittstelle kopiert:ShortOrderedSetA specific move method to move a given key to the last index.- Angegeben von:
moveToLastin SchnittstelleShortOrderedSet- Parameter:
o- that should be moved to the first last- Gibt zurück:
- true if the value was moved.
-
firstShort
public short firstShort()Beschreibung aus Schnittstelle kopiert:ShortOrderedSetA method to get the first element in the set- Angegeben von:
firstShortin SchnittstelleShortOrderedSet- Gibt zurück:
- first element in the set
-
pollFirstShort
public short pollFirstShort()Beschreibung aus Schnittstelle kopiert:ShortOrderedSetA method to get and remove the first element in the set- Angegeben von:
pollFirstShortin SchnittstelleShortOrderedSet- Gibt zurück:
- first element in the set
-
lastShort
public short lastShort()Beschreibung aus Schnittstelle kopiert:ShortOrderedSetA method to get the last element in the set- Angegeben von:
lastShortin SchnittstelleShortOrderedSet- Gibt zurück:
- last element in the set
-
pollLastShort
public short pollLastShort()Beschreibung aus Schnittstelle kopiert:ShortOrderedSetA method to get and remove the last element in the set- Angegeben von:
pollLastShortin SchnittstelleShortOrderedSet- Gibt zurück:
- last element in the set
-
clear
public void clear()- Angegeben von:
clearin SchnittstelleCollection<Short>- Angegeben von:
clearin SchnittstelleSet<Short>- Setzt außer Kraft:
clearin KlasseShortOpenCustomHashSet
-
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 KlasseShortOpenCustomHashSet- Parameter:
size- the amount of elements that should be allowed
-
toShortArray
public short[] toShortArray(short[] a) Beschreibung aus Klasse kopiert:AbstractShortCollectionA Type-Specific implementation of toArray. This implementation iterates over all elements and unwraps them into primitive type.- Angegeben von:
toShortArrayin SchnittstelleShortCollection- Setzt außer Kraft:
toShortArrayin KlasseShortOpenCustomHashSet- 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<Short>- Angegeben von:
toArrayin SchnittstelleSet<Short>- Setzt außer Kraft:
toArrayin KlasseShortOpenCustomHashSet
-
toArray
Veraltet.- Angegeben von:
toArrayin SchnittstelleCollection<Short>- Angegeben von:
toArrayin SchnittstelleSet<Short>- Setzt außer Kraft:
toArrayin KlasseShortOpenCustomHashSet
-
forEach
Beschreibung aus Schnittstelle kopiert:ShortIterableA Type Specific foreach function that reduces (un)boxing- Angegeben von:
forEachin SchnittstelleShortIterable- Setzt außer Kraft:
forEachin KlasseShortOpenCustomHashSet- Parameter:
action- The action to be performed for each element- Siehe auch:
-
forEachIndexed
Beschreibung aus Schnittstelle kopiert:ShortIterableA Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.- Angegeben von:
forEachIndexedin SchnittstelleShortIterable- Setzt außer Kraft:
forEachIndexedin KlasseShortOpenCustomHashSet- Parameter:
action- The action to be performed for each element
-
forEach
Beschreibung aus Schnittstelle kopiert:ShortIterableHelper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.- Angegeben von:
forEachin SchnittstelleShortIterable- Setzt außer Kraft:
forEachin KlasseShortOpenCustomHashSet- 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:ShortIterableHelper function to reduce stream usage that allows to filter for any matches.- Angegeben von:
matchesAnyin SchnittstelleShortIterable- Setzt außer Kraft:
matchesAnyin KlasseShortOpenCustomHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- true if any matches were found
-
matchesNone
Beschreibung aus Schnittstelle kopiert:ShortIterableHelper function to reduce stream usage that allows to filter for no matches.- Angegeben von:
matchesNonein SchnittstelleShortIterable- Setzt außer Kraft:
matchesNonein KlasseShortOpenCustomHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- true if no matches were found
-
matchesAll
Beschreibung aus Schnittstelle kopiert:ShortIterableHelper function to reduce stream usage that allows to filter for all matches.- Angegeben von:
matchesAllin SchnittstelleShortIterable- Setzt außer Kraft:
matchesAllin KlasseShortOpenCustomHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- true if all matches.
-
reduce
Beschreibung aus Schnittstelle kopiert:ShortIterablePerforms a reduction on the elements of this Iterable- Angegeben von:
reducein SchnittstelleShortIterable- Setzt außer Kraft:
reducein KlasseShortOpenCustomHashSet- 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:ShortIterablePerforms a reduction on the elements of this Iterable- Angegeben von:
reducein SchnittstelleShortIterable- Setzt außer Kraft:
reducein KlasseShortOpenCustomHashSet- 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:ShortIterableHelper function to reduce stream usage that allows to filter for the first match.- Angegeben von:
findFirstin SchnittstelleShortIterable- Setzt außer Kraft:
findFirstin KlasseShortOpenCustomHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- the found value or the null equivalent variant.
-
count
Beschreibung aus Schnittstelle kopiert:ShortIterableHelper function to reduce stream usage that allows to count the valid elements.- Angegeben von:
countin SchnittstelleShortIterable- Setzt außer Kraft:
countin KlasseShortOpenCustomHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- the amount of Valid Elements
-
iterator
Beschreibung aus Schnittstelle kopiert:ShortCollectionReturns a Type-Specific Iterator to reduce (un)boxing- Angegeben von:
iteratorin SchnittstelleCollection<Short>- Angegeben von:
iteratorin SchnittstelleIterable<Short>- Angegeben von:
iteratorin SchnittstelleSet<Short>- Angegeben von:
iteratorin SchnittstelleShortCollection- Angegeben von:
iteratorin SchnittstelleShortIterable- Angegeben von:
iteratorin SchnittstelleShortOrderedSet- Angegeben von:
iteratorin SchnittstelleShortSet- Setzt außer Kraft:
iteratorin KlasseShortOpenCustomHashSet- Gibt zurück:
- a iterator of the collection
- Siehe auch:
-
iterator
Beschreibung aus Schnittstelle kopiert:ShortOrderedSetA type Specific Iterator starting from a given key- Angegeben von:
iteratorin SchnittstelleShortOrderedSet- Parameter:
fromElement- the element the iterator should start from- Gibt zurück:
- a iterator starting from the given element
-
copy
Beschreibung aus Schnittstelle kopiert:ShortCollectionA 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 SchnittstelleShortCollection- Angegeben von:
copyin SchnittstelleShortOrderedSet- Angegeben von:
copyin SchnittstelleShortSet- Setzt außer Kraft:
copyin KlasseShortOpenCustomHashSet- Gibt zurück:
- a Shallow Copy of the collection
-