Modul speiger.src.collections
Klasse DoubleLinkedOpenCustomHashSet
java.lang.Object
java.util.AbstractCollection<Double>
speiger.src.collections.doubles.collections.AbstractDoubleCollection
speiger.src.collections.doubles.sets.AbstractDoubleSet
speiger.src.collections.doubles.sets.DoubleOpenCustomHashSet
speiger.src.collections.doubles.sets.DoubleLinkedOpenCustomHashSet
- Alle implementierten Schnittstellen:
Iterable<Double>,Collection<Double>,Set<Double>,DoubleCollection,DoubleIterable,DoubleOrderedSet,DoubleSet,ISizeProvider,ITrimmable
public class DoubleLinkedOpenCustomHashSet
extends DoubleOpenCustomHashSet
implements DoubleOrderedSet
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
KonstruktorenKonstruktorBeschreibungDoubleLinkedOpenCustomHashSet(double[] array, float loadFactor, DoubleStrategy strategy) Helper constructor that allow to create a set from unboxed valuesDoubleLinkedOpenCustomHashSet(double[] array, int offset, int length, float loadFactor, DoubleStrategy strategy) Helper constructor that allow to create a set from unboxed valuesDoubleLinkedOpenCustomHashSet(double[] array, int offset, int length, DoubleStrategy strategy) Helper constructor that allow to create a set from unboxed valuesDoubleLinkedOpenCustomHashSet(double[] array, DoubleStrategy strategy) Helper constructor that allow to create a set from unboxed valuesDoubleLinkedOpenCustomHashSet(int minCapacity, float loadFactor, DoubleStrategy strategy) Constructor that defines the minimum capacity and load factorDoubleLinkedOpenCustomHashSet(int minCapacity, DoubleStrategy strategy) Constructor that defines the minimum capacityDoubleLinkedOpenCustomHashSet(Collection<? extends Double> collection, float loadFactor, DoubleStrategy strategy) Veraltet.DoubleLinkedOpenCustomHashSet(Collection<? extends Double> collection, DoubleStrategy strategy) Veraltet.DoubleLinkedOpenCustomHashSet(Iterator<Double> iterator, float loadFactor, DoubleStrategy strategy) A Helper constructor that allows to create a set from a iterator of an unknown sizeDoubleLinkedOpenCustomHashSet(Iterator<Double> iterator, DoubleStrategy strategy) A Helper constructor that allows to create a set from a iterator of an unknown sizeDoubleLinkedOpenCustomHashSet(DoubleCollection collection, float loadFactor, DoubleStrategy strategy) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.DoubleLinkedOpenCustomHashSet(DoubleCollection collection, DoubleStrategy strategy) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.DoubleLinkedOpenCustomHashSet(DoubleIterator iterator, float loadFactor, DoubleStrategy strategy) A Helper constructor that allows to create a set from a iterator of an unknown sizeDoubleLinkedOpenCustomHashSet(DoubleIterator iterator, DoubleStrategy strategy) A Helper constructor that allows to create a set from a iterator of an unknown sizeDoubleLinkedOpenCustomHashSet(DoubleStrategy strategy) Default Contstructor -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanaddAndMoveToFirst(double o) A customized add method that allows you to insert into the first index.booleanaddAndMoveToLast(double 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(DoublePredicate filter) Helper function to reduce stream usage that allows to count the valid elements.doublefindFirst(DoublePredicate filter) Helper function to reduce stream usage that allows to filter for the first match.doubleA method to get the first element in the set<E> voidforEach(E input, ObjectDoubleConsumer<E> action) Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.voidforEach(DoubleConsumer action) A Type Specific foreach function that reduces (un)boxingvoidforEachIndexed(IntDoubleConsumer 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(double fromElement) A type Specific Iterator starting from a given keydoubleA method to get the last element in the setbooleanmatchesAll(DoublePredicate filter) Helper function to reduce stream usage that allows to filter for all matches.booleanmatchesAny(DoublePredicate filter) Helper function to reduce stream usage that allows to filter for any matches.booleanmatchesNone(DoublePredicate filter) Helper function to reduce stream usage that allows to filter for no matches.booleanmoveToFirst(double o) A specific move method to move a given key to the first index.booleanmoveToLast(double o) A specific move method to move a given key to the last index.doubleA method to get and remove the first element in the setdoubleA method to get and remove the last element in the setdoublereduce(double identity, DoubleDoubleUnaryOperator operator) Performs a reduction on the elements of this Iterabledoublereduce(DoubleDoubleUnaryOperator operator) Performs a reduction on the elements of this IterableObject[]toArray()Veraltet.<E> E[]toArray(E[] a) Veraltet.double[]toDoubleArray(double[] a) A Type-Specific implementation of toArray.Von Klasse geerbte Methoden speiger.src.collections.doubles.sets.DoubleOpenCustomHashSet
add, addAll, addAll, contains, getStrategy, remove, size, trimVon Klasse geerbte Methoden speiger.src.collections.doubles.sets.AbstractDoubleSet
equals, hashCodeVon Klasse geerbte Methoden speiger.src.collections.doubles.collections.AbstractDoubleCollection
add, contains, containsAll, containsAll, containsAny, containsAny, remDouble, remove, removeAll, removeAll, retainAll, retainAll, toDoubleArrayVon 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.doubles.collections.DoubleCollection
add, addAll, addAll, addAll, addAll, contains, containsAll, containsAny, containsAny, parallelPrimitiveStream, pour, primitiveStream, remIf, removeAll, removeAll, removeIf, retainAll, retainAll, spliterator, toDoubleArrayVon Schnittstelle geerbte Methoden speiger.src.collections.doubles.collections.DoubleIterable
arrayflatMap, asAsync, distinct, filter, flatMap, forEach, limit, map, peek, pourAsList, pourAsSet, repeat, sortedVon Schnittstelle geerbte Methoden speiger.src.collections.doubles.sets.DoubleOrderedSet
spliterator, synchronize, synchronize, unmodifiableVon Schnittstelle geerbte Methoden speiger.src.collections.doubles.sets.DoubleSet
add, contains, remDouble, remove, removeVon Schnittstelle geerbte Methoden speiger.src.collections.utils.ISizeProvider
sizeVon Schnittstelle geerbte Methoden speiger.src.collections.utils.ITrimmable
clearAndTrim, trim
-
Konstruktordetails
-
DoubleLinkedOpenCustomHashSet
Default Contstructor- Parameter:
strategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is null
-
DoubleLinkedOpenCustomHashSet
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
-
DoubleLinkedOpenCustomHashSet
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
-
DoubleLinkedOpenCustomHashSet
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
-
DoubleLinkedOpenCustomHashSet
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
-
DoubleLinkedOpenCustomHashSet
public DoubleLinkedOpenCustomHashSet(double[] array, int offset, int length, DoubleStrategy 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 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
-
DoubleLinkedOpenCustomHashSet
public DoubleLinkedOpenCustomHashSet(double[] array, int offset, int length, float loadFactor, DoubleStrategy 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
-
DoubleLinkedOpenCustomHashSet
@Deprecated public DoubleLinkedOpenCustomHashSet(Collection<? extends Double> collection, DoubleStrategy 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
-
DoubleLinkedOpenCustomHashSet
@Deprecated public DoubleLinkedOpenCustomHashSet(Collection<? extends Double> collection, float loadFactor, DoubleStrategy 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
-
DoubleLinkedOpenCustomHashSet
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
-
DoubleLinkedOpenCustomHashSet
public DoubleLinkedOpenCustomHashSet(DoubleCollection collection, float loadFactor, DoubleStrategy 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
-
DoubleLinkedOpenCustomHashSet
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
-
DoubleLinkedOpenCustomHashSet
public DoubleLinkedOpenCustomHashSet(Iterator<Double> iterator, float loadFactor, DoubleStrategy 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
-
DoubleLinkedOpenCustomHashSet
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
-
DoubleLinkedOpenCustomHashSet
public DoubleLinkedOpenCustomHashSet(DoubleIterator iterator, float loadFactor, DoubleStrategy 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(double o) Beschreibung aus Schnittstelle kopiert:DoubleOrderedSetA customized add method that allows you to insert into the first index.- Angegeben von:
addAndMoveToFirstin SchnittstelleDoubleOrderedSet- Parameter:
o- the element that should be inserted- Gibt zurück:
- true if it was added
- Siehe auch:
-
addAndMoveToLast
public boolean addAndMoveToLast(double o) Beschreibung aus Schnittstelle kopiert:DoubleOrderedSetA customized add method that allows you to insert into the last index.- Angegeben von:
addAndMoveToLastin SchnittstelleDoubleOrderedSet- Parameter:
o- the element that should be inserted- Gibt zurück:
- true if it was added
- Siehe auch:
-
moveToFirst
public boolean moveToFirst(double o) Beschreibung aus Schnittstelle kopiert:DoubleOrderedSetA specific move method to move a given key to the first index.- Angegeben von:
moveToFirstin SchnittstelleDoubleOrderedSet- Parameter:
o- that should be moved to the first index- Gibt zurück:
- true if the value was moved.
-
moveToLast
public boolean moveToLast(double o) Beschreibung aus Schnittstelle kopiert:DoubleOrderedSetA specific move method to move a given key to the last index.- Angegeben von:
moveToLastin SchnittstelleDoubleOrderedSet- Parameter:
o- that should be moved to the first last- Gibt zurück:
- true if the value was moved.
-
firstDouble
public double firstDouble()Beschreibung aus Schnittstelle kopiert:DoubleOrderedSetA method to get the first element in the set- Angegeben von:
firstDoublein SchnittstelleDoubleOrderedSet- Gibt zurück:
- first element in the set
-
pollFirstDouble
public double pollFirstDouble()Beschreibung aus Schnittstelle kopiert:DoubleOrderedSetA method to get and remove the first element in the set- Angegeben von:
pollFirstDoublein SchnittstelleDoubleOrderedSet- Gibt zurück:
- first element in the set
-
lastDouble
public double lastDouble()Beschreibung aus Schnittstelle kopiert:DoubleOrderedSetA method to get the last element in the set- Angegeben von:
lastDoublein SchnittstelleDoubleOrderedSet- Gibt zurück:
- last element in the set
-
pollLastDouble
public double pollLastDouble()Beschreibung aus Schnittstelle kopiert:DoubleOrderedSetA method to get and remove the last element in the set- Angegeben von:
pollLastDoublein SchnittstelleDoubleOrderedSet- Gibt zurück:
- last element in the set
-
clear
public void clear()- Angegeben von:
clearin SchnittstelleCollection<Double>- Angegeben von:
clearin SchnittstelleSet<Double>- Setzt außer Kraft:
clearin KlasseDoubleOpenCustomHashSet
-
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 KlasseDoubleOpenCustomHashSet- Parameter:
size- the amount of elements that should be allowed
-
toDoubleArray
public double[] toDoubleArray(double[] a) Beschreibung aus Klasse kopiert:AbstractDoubleCollectionA Type-Specific implementation of toArray. This implementation iterates over all elements and unwraps them into primitive type.- Angegeben von:
toDoubleArrayin SchnittstelleDoubleCollection- Setzt außer Kraft:
toDoubleArrayin KlasseDoubleOpenCustomHashSet- 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<Double>- Angegeben von:
toArrayin SchnittstelleSet<Double>- Setzt außer Kraft:
toArrayin KlasseDoubleOpenCustomHashSet
-
toArray
Veraltet.- Angegeben von:
toArrayin SchnittstelleCollection<Double>- Angegeben von:
toArrayin SchnittstelleSet<Double>- Setzt außer Kraft:
toArrayin KlasseDoubleOpenCustomHashSet
-
forEach
Beschreibung aus Schnittstelle kopiert:DoubleIterableA Type Specific foreach function that reduces (un)boxing- Angegeben von:
forEachin SchnittstelleDoubleIterable- Setzt außer Kraft:
forEachin KlasseDoubleOpenCustomHashSet- Parameter:
action- The action to be performed for each element- Siehe auch:
-
forEachIndexed
Beschreibung aus Schnittstelle kopiert:DoubleIterableA Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.- Angegeben von:
forEachIndexedin SchnittstelleDoubleIterable- Setzt außer Kraft:
forEachIndexedin KlasseDoubleOpenCustomHashSet- Parameter:
action- The action to be performed for each element
-
forEach
Beschreibung aus Schnittstelle kopiert:DoubleIterableHelper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.- Angegeben von:
forEachin SchnittstelleDoubleIterable- Setzt außer Kraft:
forEachin KlasseDoubleOpenCustomHashSet- 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:DoubleIterableHelper function to reduce stream usage that allows to filter for any matches.- Angegeben von:
matchesAnyin SchnittstelleDoubleIterable- Setzt außer Kraft:
matchesAnyin KlasseDoubleOpenCustomHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- true if any matches were found
-
matchesNone
Beschreibung aus Schnittstelle kopiert:DoubleIterableHelper function to reduce stream usage that allows to filter for no matches.- Angegeben von:
matchesNonein SchnittstelleDoubleIterable- Setzt außer Kraft:
matchesNonein KlasseDoubleOpenCustomHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- true if no matches were found
-
matchesAll
Beschreibung aus Schnittstelle kopiert:DoubleIterableHelper function to reduce stream usage that allows to filter for all matches.- Angegeben von:
matchesAllin SchnittstelleDoubleIterable- Setzt außer Kraft:
matchesAllin KlasseDoubleOpenCustomHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- true if all matches.
-
reduce
Beschreibung aus Schnittstelle kopiert:DoubleIterablePerforms a reduction on the elements of this Iterable- Angegeben von:
reducein SchnittstelleDoubleIterable- Setzt außer Kraft:
reducein KlasseDoubleOpenCustomHashSet- 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:DoubleIterablePerforms a reduction on the elements of this Iterable- Angegeben von:
reducein SchnittstelleDoubleIterable- Setzt außer Kraft:
reducein KlasseDoubleOpenCustomHashSet- 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:DoubleIterableHelper function to reduce stream usage that allows to filter for the first match.- Angegeben von:
findFirstin SchnittstelleDoubleIterable- Setzt außer Kraft:
findFirstin KlasseDoubleOpenCustomHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- the found value or the null equivalent variant.
-
count
Beschreibung aus Schnittstelle kopiert:DoubleIterableHelper function to reduce stream usage that allows to count the valid elements.- Angegeben von:
countin SchnittstelleDoubleIterable- Setzt außer Kraft:
countin KlasseDoubleOpenCustomHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- the amount of Valid Elements
-
iterator
Beschreibung aus Schnittstelle kopiert:DoubleCollectionReturns a Type-Specific Iterator to reduce (un)boxing- Angegeben von:
iteratorin SchnittstelleCollection<Double>- Angegeben von:
iteratorin SchnittstelleDoubleCollection- Angegeben von:
iteratorin SchnittstelleDoubleIterable- Angegeben von:
iteratorin SchnittstelleDoubleOrderedSet- Angegeben von:
iteratorin SchnittstelleDoubleSet- Angegeben von:
iteratorin SchnittstelleIterable<Double>- Angegeben von:
iteratorin SchnittstelleSet<Double>- Setzt außer Kraft:
iteratorin KlasseDoubleOpenCustomHashSet- Gibt zurück:
- a iterator of the collection
- Siehe auch:
-
iterator
Beschreibung aus Schnittstelle kopiert:DoubleOrderedSetA type Specific Iterator starting from a given key- Angegeben von:
iteratorin SchnittstelleDoubleOrderedSet- Parameter:
fromElement- the element the iterator should start from- Gibt zurück:
- a iterator starting from the given element
-
copy
Beschreibung aus Schnittstelle kopiert:DoubleCollectionA 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 SchnittstelleDoubleCollection- Angegeben von:
copyin SchnittstelleDoubleOrderedSet- Angegeben von:
copyin SchnittstelleDoubleSet- Setzt außer Kraft:
copyin KlasseDoubleOpenCustomHashSet- Gibt zurück:
- a Shallow Copy of the collection
-