Modul speiger.src.collections
Klasse LongLinkedOpenCustomHashSet
java.lang.Object
java.util.AbstractCollection<Long>
speiger.src.collections.longs.collections.AbstractLongCollection
speiger.src.collections.longs.sets.AbstractLongSet
speiger.src.collections.longs.sets.LongOpenCustomHashSet
speiger.src.collections.longs.sets.LongLinkedOpenCustomHashSet
- Alle implementierten Schnittstellen:
Iterable<Long>,Collection<Long>,Set<Long>,LongCollection,LongIterable,LongOrderedSet,LongSet,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
KonstruktorenKonstruktorBeschreibungLongLinkedOpenCustomHashSet(int minCapacity, float loadFactor, LongStrategy strategy) Constructor that defines the minimum capacity and load factorLongLinkedOpenCustomHashSet(int minCapacity, LongStrategy strategy) Constructor that defines the minimum capacityLongLinkedOpenCustomHashSet(long[] array, float loadFactor, LongStrategy strategy) Helper constructor that allow to create a set from unboxed valuesLongLinkedOpenCustomHashSet(long[] array, int offset, int length, float loadFactor, LongStrategy strategy) Helper constructor that allow to create a set from unboxed valuesLongLinkedOpenCustomHashSet(long[] array, int offset, int length, LongStrategy strategy) Helper constructor that allow to create a set from unboxed valuesLongLinkedOpenCustomHashSet(long[] array, LongStrategy strategy) Helper constructor that allow to create a set from unboxed valuesLongLinkedOpenCustomHashSet(Collection<? extends Long> collection, float loadFactor, LongStrategy strategy) Veraltet.LongLinkedOpenCustomHashSet(Collection<? extends Long> collection, LongStrategy strategy) Veraltet.LongLinkedOpenCustomHashSet(Iterator<Long> iterator, float loadFactor, LongStrategy strategy) A Helper constructor that allows to create a set from a iterator of an unknown sizeLongLinkedOpenCustomHashSet(Iterator<Long> iterator, LongStrategy strategy) A Helper constructor that allows to create a set from a iterator of an unknown sizeLongLinkedOpenCustomHashSet(LongCollection collection, float loadFactor, LongStrategy strategy) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.LongLinkedOpenCustomHashSet(LongCollection collection, LongStrategy strategy) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.LongLinkedOpenCustomHashSet(LongIterator iterator, float loadFactor, LongStrategy strategy) A Helper constructor that allows to create a set from a iterator of an unknown sizeLongLinkedOpenCustomHashSet(LongIterator iterator, LongStrategy strategy) A Helper constructor that allows to create a set from a iterator of an unknown sizeLongLinkedOpenCustomHashSet(LongStrategy strategy) Default Contstructor -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanaddAndMoveToFirst(long o) A customized add method that allows you to insert into the first index.booleanaddAndMoveToLast(long 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(LongPredicate filter) Helper function to reduce stream usage that allows to count the valid elements.longfindFirst(LongPredicate filter) Helper function to reduce stream usage that allows to filter for the first match.longA method to get the first element in the set<E> voidforEach(E input, ObjectLongConsumer<E> action) Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.voidforEach(LongConsumer action) A Type Specific foreach function that reduces (un)boxingvoidforEachIndexed(IntLongConsumer 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(long fromElement) A type Specific Iterator starting from a given keylonglastLong()A method to get the last element in the setbooleanmatchesAll(LongPredicate filter) Helper function to reduce stream usage that allows to filter for all matches.booleanmatchesAny(LongPredicate filter) Helper function to reduce stream usage that allows to filter for any matches.booleanmatchesNone(LongPredicate filter) Helper function to reduce stream usage that allows to filter for no matches.booleanmoveToFirst(long o) A specific move method to move a given key to the first index.booleanmoveToLast(long o) A specific move method to move a given key to the last index.longA method to get and remove the first element in the setlongA method to get and remove the last element in the setlongreduce(long identity, LongLongUnaryOperator operator) Performs a reduction on the elements of this Iterablelongreduce(LongLongUnaryOperator operator) Performs a reduction on the elements of this IterableObject[]toArray()Veraltet.<E> E[]toArray(E[] a) Veraltet.long[]toLongArray(long[] a) A Type-Specific implementation of toArray.Von Klasse geerbte Methoden speiger.src.collections.longs.sets.LongOpenCustomHashSet
add, addAll, addAll, contains, getStrategy, remove, size, trimVon Klasse geerbte Methoden speiger.src.collections.longs.sets.AbstractLongSet
equals, hashCodeVon Klasse geerbte Methoden speiger.src.collections.longs.collections.AbstractLongCollection
add, contains, containsAll, containsAll, containsAny, containsAny, remLong, remove, removeAll, removeAll, retainAll, retainAll, toLongArrayVon 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 speiger.src.collections.longs.collections.LongCollection
add, addAll, addAll, addAll, addAll, contains, containsAll, containsAny, containsAny, parallelPrimitiveStream, pour, primitiveStream, remIf, removeAll, removeAll, removeIf, retainAll, retainAll, spliterator, toLongArrayVon Schnittstelle geerbte Methoden speiger.src.collections.longs.collections.LongIterable
arrayflatMap, asAsync, distinct, filter, flatMap, forEach, limit, map, peek, pourAsList, pourAsSet, repeat, sortedVon Schnittstelle geerbte Methoden speiger.src.collections.longs.sets.LongOrderedSet
spliterator, synchronize, synchronize, unmodifiable
-
Konstruktordetails
-
LongLinkedOpenCustomHashSet
Default Contstructor- Parameter:
strategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is null
-
LongLinkedOpenCustomHashSet
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
-
LongLinkedOpenCustomHashSet
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
-
LongLinkedOpenCustomHashSet
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
-
LongLinkedOpenCustomHashSet
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
-
LongLinkedOpenCustomHashSet
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
-
LongLinkedOpenCustomHashSet
public LongLinkedOpenCustomHashSet(long[] array, int offset, int length, float loadFactor, LongStrategy 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
-
LongLinkedOpenCustomHashSet
@Deprecated public LongLinkedOpenCustomHashSet(Collection<? extends Long> collection, LongStrategy 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
-
LongLinkedOpenCustomHashSet
@Deprecated public LongLinkedOpenCustomHashSet(Collection<? extends Long> collection, float loadFactor, LongStrategy 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
-
LongLinkedOpenCustomHashSet
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
-
LongLinkedOpenCustomHashSet
public LongLinkedOpenCustomHashSet(LongCollection collection, float loadFactor, LongStrategy 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
-
LongLinkedOpenCustomHashSet
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
-
LongLinkedOpenCustomHashSet
public LongLinkedOpenCustomHashSet(Iterator<Long> iterator, float loadFactor, LongStrategy 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
-
LongLinkedOpenCustomHashSet
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
-
LongLinkedOpenCustomHashSet
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(long o) Beschreibung aus Schnittstelle kopiert:LongOrderedSetA customized add method that allows you to insert into the first index.- Angegeben von:
addAndMoveToFirstin SchnittstelleLongOrderedSet- Parameter:
o- the element that should be inserted- Gibt zurück:
- true if it was added
- Siehe auch:
-
addAndMoveToLast
public boolean addAndMoveToLast(long o) Beschreibung aus Schnittstelle kopiert:LongOrderedSetA customized add method that allows you to insert into the last index.- Angegeben von:
addAndMoveToLastin SchnittstelleLongOrderedSet- Parameter:
o- the element that should be inserted- Gibt zurück:
- true if it was added
- Siehe auch:
-
moveToFirst
public boolean moveToFirst(long o) Beschreibung aus Schnittstelle kopiert:LongOrderedSetA specific move method to move a given key to the first index.- Angegeben von:
moveToFirstin SchnittstelleLongOrderedSet- Parameter:
o- that should be moved to the first index- Gibt zurück:
- true if the value was moved.
-
moveToLast
public boolean moveToLast(long o) Beschreibung aus Schnittstelle kopiert:LongOrderedSetA specific move method to move a given key to the last index.- Angegeben von:
moveToLastin SchnittstelleLongOrderedSet- Parameter:
o- that should be moved to the first last- Gibt zurück:
- true if the value was moved.
-
firstLong
public long firstLong()Beschreibung aus Schnittstelle kopiert:LongOrderedSetA method to get the first element in the set- Angegeben von:
firstLongin SchnittstelleLongOrderedSet- Gibt zurück:
- first element in the set
-
pollFirstLong
public long pollFirstLong()Beschreibung aus Schnittstelle kopiert:LongOrderedSetA method to get and remove the first element in the set- Angegeben von:
pollFirstLongin SchnittstelleLongOrderedSet- Gibt zurück:
- first element in the set
-
lastLong
public long lastLong()Beschreibung aus Schnittstelle kopiert:LongOrderedSetA method to get the last element in the set- Angegeben von:
lastLongin SchnittstelleLongOrderedSet- Gibt zurück:
- last element in the set
-
pollLastLong
public long pollLastLong()Beschreibung aus Schnittstelle kopiert:LongOrderedSetA method to get and remove the last element in the set- Angegeben von:
pollLastLongin SchnittstelleLongOrderedSet- Gibt zurück:
- last element in the set
-
clear
public void clear()- Angegeben von:
clearin SchnittstelleCollection<Long>- Angegeben von:
clearin SchnittstelleSet<Long>- Setzt außer Kraft:
clearin KlasseLongOpenCustomHashSet
-
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 KlasseLongOpenCustomHashSet- Parameter:
size- the amount of elements that should be allowed
-
toLongArray
public long[] toLongArray(long[] a) Beschreibung aus Klasse kopiert:AbstractLongCollectionA Type-Specific implementation of toArray. This implementation iterates over all elements and unwraps them into primitive type.- Angegeben von:
toLongArrayin SchnittstelleLongCollection- Setzt außer Kraft:
toLongArrayin KlasseLongOpenCustomHashSet- 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<Long>- Angegeben von:
toArrayin SchnittstelleSet<Long>- Setzt außer Kraft:
toArrayin KlasseLongOpenCustomHashSet
-
toArray
Veraltet.- Angegeben von:
toArrayin SchnittstelleCollection<Long>- Angegeben von:
toArrayin SchnittstelleSet<Long>- Setzt außer Kraft:
toArrayin KlasseLongOpenCustomHashSet
-
forEach
Beschreibung aus Schnittstelle kopiert:LongIterableA Type Specific foreach function that reduces (un)boxing- Angegeben von:
forEachin SchnittstelleLongIterable- Setzt außer Kraft:
forEachin KlasseLongOpenCustomHashSet- Parameter:
action- The action to be performed for each element- Siehe auch:
-
forEachIndexed
Beschreibung aus Schnittstelle kopiert:LongIterableA Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.- Angegeben von:
forEachIndexedin SchnittstelleLongIterable- Setzt außer Kraft:
forEachIndexedin KlasseLongOpenCustomHashSet- Parameter:
action- The action to be performed for each element
-
forEach
Beschreibung aus Schnittstelle kopiert:LongIterableHelper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.- Angegeben von:
forEachin SchnittstelleLongIterable- Setzt außer Kraft:
forEachin KlasseLongOpenCustomHashSet- 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:LongIterableHelper function to reduce stream usage that allows to filter for any matches.- Angegeben von:
matchesAnyin SchnittstelleLongIterable- Setzt außer Kraft:
matchesAnyin KlasseLongOpenCustomHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- true if any matches were found
-
matchesNone
Beschreibung aus Schnittstelle kopiert:LongIterableHelper function to reduce stream usage that allows to filter for no matches.- Angegeben von:
matchesNonein SchnittstelleLongIterable- Setzt außer Kraft:
matchesNonein KlasseLongOpenCustomHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- true if no matches were found
-
matchesAll
Beschreibung aus Schnittstelle kopiert:LongIterableHelper function to reduce stream usage that allows to filter for all matches.- Angegeben von:
matchesAllin SchnittstelleLongIterable- Setzt außer Kraft:
matchesAllin KlasseLongOpenCustomHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- true if all matches.
-
reduce
Beschreibung aus Schnittstelle kopiert:LongIterablePerforms a reduction on the elements of this Iterable- Angegeben von:
reducein SchnittstelleLongIterable- Setzt außer Kraft:
reducein KlasseLongOpenCustomHashSet- 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:LongIterablePerforms a reduction on the elements of this Iterable- Angegeben von:
reducein SchnittstelleLongIterable- Setzt außer Kraft:
reducein KlasseLongOpenCustomHashSet- 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:LongIterableHelper function to reduce stream usage that allows to filter for the first match.- Angegeben von:
findFirstin SchnittstelleLongIterable- Setzt außer Kraft:
findFirstin KlasseLongOpenCustomHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- the found value or the null equivalent variant.
-
count
Beschreibung aus Schnittstelle kopiert:LongIterableHelper function to reduce stream usage that allows to count the valid elements.- Angegeben von:
countin SchnittstelleLongIterable- Setzt außer Kraft:
countin KlasseLongOpenCustomHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- the amount of Valid Elements
-
iterator
Beschreibung aus Schnittstelle kopiert:LongCollectionReturns a Type-Specific Iterator to reduce (un)boxing- Angegeben von:
iteratorin SchnittstelleCollection<Long>- Angegeben von:
iteratorin SchnittstelleIterable<Long>- Angegeben von:
iteratorin SchnittstelleLongCollection- Angegeben von:
iteratorin SchnittstelleLongIterable- Angegeben von:
iteratorin SchnittstelleLongOrderedSet- Angegeben von:
iteratorin SchnittstelleLongSet- Angegeben von:
iteratorin SchnittstelleSet<Long>- Setzt außer Kraft:
iteratorin KlasseLongOpenCustomHashSet- Gibt zurück:
- a iterator of the collection
- Siehe auch:
-
iterator
Beschreibung aus Schnittstelle kopiert:LongOrderedSetA type Specific Iterator starting from a given key- Angegeben von:
iteratorin SchnittstelleLongOrderedSet- Parameter:
fromElement- the element the iterator should start from- Gibt zurück:
- a iterator starting from the given element
-
copy
Beschreibung aus Schnittstelle kopiert:LongCollectionA 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 SchnittstelleLongCollection- Angegeben von:
copyin SchnittstelleLongOrderedSet- Angegeben von:
copyin SchnittstelleLongSet- Setzt außer Kraft:
copyin KlasseLongOpenCustomHashSet- Gibt zurück:
- a Shallow Copy of the collection
-