java.lang.Object
java.util.AbstractCollection<Double>
speiger.src.collections.doubles.collections.AbstractDoubleCollection
speiger.src.collections.doubles.sets.AbstractDoubleSet
speiger.src.collections.doubles.sets.DoubleRBTreeSet
- Alle implementierten Schnittstellen:
Iterable<Double>,Collection<Double>,NavigableSet<Double>,Set<Double>,SortedSet<Double>,DoubleCollection,DoubleIterable,DoubleNavigableSet,DoubleSet,DoubleSortedSet,ISizeProvider
A Simple Type Specific RB TreeSet implementation that reduces boxing/unboxing.
It is using a bit more memory then FastUtil,
but it saves a lot of Performance on the Optimized removal and iteration logic.
Which makes the implementation actually useable and does not get outperformed by Javas default implementation.
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen speiger.src.collections.utils.ISizeProvider
ISizeProvider.CollectionSize -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungDefault ConstructorDoubleRBTreeSet(double[] array) Helper constructor that allow to create a set from an arrayDoubleRBTreeSet(double[] array, int offset, int length) Helper constructor that allow to create a set from an arrayDoubleRBTreeSet(double[] array, int offset, int length, DoubleComparator comp) Helper constructor that allow to create a set from an arrayDoubleRBTreeSet(double[] array, DoubleComparator comp) Helper constructor that allow to create a set from an arrayDoubleRBTreeSet(Collection<? extends Double> collection) Veraltet.DoubleRBTreeSet(Collection<? extends Double> collection, DoubleComparator comp) Veraltet.DoubleRBTreeSet(Iterator<Double> iterator) A Helper constructor that allows to create a set from a iterator of an unknown sizeDoubleRBTreeSet(Iterator<Double> iterator, DoubleComparator comp) A Helper constructor that allows to create a set from a iterator of an unknown sizeDoubleRBTreeSet(DoubleCollection collection) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.DoubleRBTreeSet(DoubleCollection collection, DoubleComparator comp) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.DoubleRBTreeSet(DoubleIterator iterator) A Helper constructor that allows to create a set from a iterator of an unknown sizeDoubleRBTreeSet(DoubleIterator iterator, DoubleComparator comp) A Helper constructor that allows to create a set from a iterator of an unknown sizeConstructor that allows to define the sorterDoubleRBTreeSet(DoubleSortedSet sortedSet) A Helper constructor that allows to create a Set with exactly the same values as the provided SortedSet. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanadd(double o) A Type-Specific add function to reduce (un)boxingdoubleceiling(double e) A Type Specific ceiling method to reduce boxing/unboxing.voidclear()A Type Specific Comparator methodbooleancontains(double e) A Type-Specific implementation of contains.booleancopy()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 setdoublefloor(double e) A Type Specific floor method to reduce boxing/unboxing.<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.doubleA Helper method to get the max value for SubSets.doubleA Helper method to get the min value for SubSets.headSet(double toElement, boolean inclusive) A Type Specific HeadSet method to reduce boxing/unboxingdoublehigher(double e) A Type Specific higher method to reduce boxing/unboxing.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 setdoublelower(double e) A Type Specific lower method to reduce boxing/unboxing.booleanmatchesAll(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.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 Iterablebooleanremove(double o) A Type Specific remove function to reduce boxing/unboxingbooleanvoidsetDefaultMaxValue(double value) A Helper method to set the max value for SubSets.voidsetDefaultMinValue(double value) A Helper method to set the min value for SubSets.intsize()subSet(double fromElement, boolean fromInclusive, double toElement, boolean toInclusive) A Type Specific SubSet method to reduce boxing/unboxingtailSet(double fromElement, boolean inclusive) A Type Specific TailSet method to reduce boxing/unboxingObject[]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.AbstractDoubleSet
equals, hashCodeVon Klasse geerbte Methoden speiger.src.collections.doubles.collections.AbstractDoubleCollection
add, addAll, addAll, containsAll, containsAll, containsAny, containsAny, remDouble, 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
addAll, addAll, addAll, addAll, 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.DoubleNavigableSet
first, headSet, headSet, headSet, last, pollFirst, pollLast, spliterator, subSet, subSet, subSet, synchronize, synchronize, tailSet, tailSet, tailSet, unmodifiable
-
Konstruktordetails
-
DoubleRBTreeSet
public DoubleRBTreeSet()Default Constructor -
DoubleRBTreeSet
Constructor that allows to define the sorter- Parameter:
comp- the function that decides how the tree is sorted, can be null
-
DoubleRBTreeSet
public DoubleRBTreeSet(double[] array) Helper constructor that allow to create a set from an array- Parameter:
array- the elements that should be used
-
DoubleRBTreeSet
public DoubleRBTreeSet(double[] array, int offset, int length) Helper constructor that allow to create a set from an array- Parameter:
array- the elements that should be usedoffset- the starting index within the arraylength- the amount of elements that are within the array- Löst aus:
IllegalStateException- if offset and length causes to step outside of the arrays range
-
DoubleRBTreeSet
Helper constructor that allow to create a set from an array- Parameter:
array- the elements that should be usedcomp- the sorter of the tree, can be null
-
DoubleRBTreeSet
Helper constructor that allow to create a set from an array- Parameter:
array- the elements that should be usedoffset- the starting index within the arraylength- the amount of elements that are within the arraycomp- the sorter of the tree, can be null- Löst aus:
IllegalStateException- if offset and length causes to step outside of the arrays range
-
DoubleRBTreeSet
A Helper constructor that allows to create a Set with exactly the same values as the provided SortedSet.- Parameter:
sortedSet- the set the elements should be added to the TreeSet- Note:
- this also includes the Comparator if present
-
DoubleRBTreeSet
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 TreeSet
-
DoubleRBTreeSet
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 TreeSetcomp- the sorter of the tree, can be null
-
DoubleRBTreeSet
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 TreeSet
-
DoubleRBTreeSet
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 TreeSetcomp- the sorter of the tree, can be null
-
DoubleRBTreeSet
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
-
DoubleRBTreeSet
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 setcomp- the sorter of the tree, can be null
-
DoubleRBTreeSet
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
-
DoubleRBTreeSet
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 setcomp- the sorter of the tree, can be null
-
-
Methodendetails
-
setDefaultMaxValue
public void setDefaultMaxValue(double value) Beschreibung aus Schnittstelle kopiert:DoubleNavigableSetA Helper method to set the max value for SubSets. (Default: double.MIN_VALUE)- Angegeben von:
setDefaultMaxValuein SchnittstelleDoubleNavigableSet- Parameter:
value- the new max value
-
getDefaultMaxValue
public double getDefaultMaxValue()Beschreibung aus Schnittstelle kopiert:DoubleNavigableSetA Helper method to get the max value for SubSets.- Angegeben von:
getDefaultMaxValuein SchnittstelleDoubleNavigableSet- Gibt zurück:
- the default max value.
-
setDefaultMinValue
public void setDefaultMinValue(double value) Beschreibung aus Schnittstelle kopiert:DoubleNavigableSetA Helper method to set the min value for SubSets. (Default: double.MAX_VALUE)- Angegeben von:
setDefaultMinValuein SchnittstelleDoubleNavigableSet- Parameter:
value- the new min value
-
getDefaultMinValue
public double getDefaultMinValue()Beschreibung aus Schnittstelle kopiert:DoubleNavigableSetA Helper method to get the min value for SubSets.- Angegeben von:
getDefaultMinValuein SchnittstelleDoubleNavigableSet- Gibt zurück:
- the default min value.
-
add
public boolean add(double o) Beschreibung aus Schnittstelle kopiert:DoubleCollectionA Type-Specific add function to reduce (un)boxing- Angegeben von:
addin SchnittstelleDoubleCollection- Parameter:
o- the element that should be added- Gibt zurück:
- true if the element was added to the collection
-
lower
public double lower(double e) Beschreibung aus Schnittstelle kopiert:DoubleNavigableSetA Type Specific lower method to reduce boxing/unboxing.- Angegeben von:
lowerin SchnittstelleDoubleNavigableSet- Parameter:
e- that should be compared with.- Gibt zurück:
- the greatest lower key that can be found
-
floor
public double floor(double e) Beschreibung aus Schnittstelle kopiert:DoubleNavigableSetA Type Specific floor method to reduce boxing/unboxing.- Angegeben von:
floorin SchnittstelleDoubleNavigableSet- Parameter:
e- that should be compared with.- Gibt zurück:
- the greatest lower or equal key that can be found
-
higher
public double higher(double e) Beschreibung aus Schnittstelle kopiert:DoubleNavigableSetA Type Specific higher method to reduce boxing/unboxing.- Angegeben von:
higherin SchnittstelleDoubleNavigableSet- Parameter:
e- that should be compared with.- Gibt zurück:
- the lowest higher key that can be found
-
ceiling
public double ceiling(double e) Beschreibung aus Schnittstelle kopiert:DoubleNavigableSetA Type Specific ceiling method to reduce boxing/unboxing.- Angegeben von:
ceilingin SchnittstelleDoubleNavigableSet- Parameter:
e- that should be compared with.- Gibt zurück:
- the lowest higher or equal key that can be found
-
lower
- Angegeben von:
lowerin SchnittstelleDoubleNavigableSet- Angegeben von:
lowerin SchnittstelleNavigableSet<Double>
-
floor
- Angegeben von:
floorin SchnittstelleDoubleNavigableSet- Angegeben von:
floorin SchnittstelleNavigableSet<Double>
-
higher
- Angegeben von:
higherin SchnittstelleDoubleNavigableSet- Angegeben von:
higherin SchnittstelleNavigableSet<Double>
-
ceiling
- Angegeben von:
ceilingin SchnittstelleDoubleNavigableSet- Angegeben von:
ceilingin SchnittstelleNavigableSet<Double>
-
forEach
Beschreibung aus Schnittstelle kopiert:DoubleIterableA Type Specific foreach function that reduces (un)boxing- Angegeben von:
forEachin SchnittstelleDoubleIterable- 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- 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- 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- 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- 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- 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- 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- 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- 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- Parameter:
filter- that should be applied- Gibt zurück:
- the amount of Valid Elements
-
contains
public boolean contains(double e) Beschreibung aus Klasse kopiert:AbstractDoubleCollectionA Type-Specific implementation of contains. This implementation iterates over the elements and returns true if the value match.- Angegeben von:
containsin SchnittstelleDoubleCollection- Setzt außer Kraft:
containsin KlasseAbstractDoubleCollection- Parameter:
e- the element that should be searched for.- Gibt zurück:
- true if the value was found.
-
contains
Beschreibung aus Klasse kopiert:AbstractDoubleCollectionThis default implementation delegates to the corresponding type-specific function.
This default implementation delegates to the corresponding type-specific function.
- Angegeben von:
containsin SchnittstelleCollection<Double>- Angegeben von:
containsin SchnittstelleDoubleCollection- Angegeben von:
containsin SchnittstelleDoubleSet- Angegeben von:
containsin SchnittstelleSet<Double>- Setzt außer Kraft:
containsin KlasseAbstractDoubleCollection
-
firstDouble
public double firstDouble()Beschreibung aus Schnittstelle kopiert:DoubleSortedSetA method to get the first element in the set- Angegeben von:
firstDoublein SchnittstelleDoubleSortedSet- Gibt zurück:
- first element in the set
-
lastDouble
public double lastDouble()Beschreibung aus Schnittstelle kopiert:DoubleSortedSetA method to get the last element in the set- Angegeben von:
lastDoublein SchnittstelleDoubleSortedSet- Gibt zurück:
- last element in the set
-
remove
public boolean remove(double o) Beschreibung aus Schnittstelle kopiert:DoubleSetA Type Specific remove function to reduce boxing/unboxing -
remove
Beschreibung aus Klasse kopiert:AbstractDoubleCollectionThis default implementation delegates to the corresponding type-specific function.
This default implementation delegates to the corresponding type-specific function.
- Angegeben von:
removein SchnittstelleCollection<Double>- Angegeben von:
removein SchnittstelleDoubleCollection- Angegeben von:
removein SchnittstelleDoubleSet- Angegeben von:
removein SchnittstelleSet<Double>- Setzt außer Kraft:
removein KlasseAbstractDoubleCollection
-
pollFirstDouble
public double pollFirstDouble()Beschreibung aus Schnittstelle kopiert:DoubleSortedSetA method to get and remove the first element in the set- Angegeben von:
pollFirstDoublein SchnittstelleDoubleSortedSet- Gibt zurück:
- first element in the set
-
pollLastDouble
public double pollLastDouble()Beschreibung aus Schnittstelle kopiert:DoubleSortedSetA method to get and remove the last element in the set- Angegeben von:
pollLastDoublein SchnittstelleDoubleSortedSet- Gibt zurück:
- last element in the set
-
size
public int size()- Angegeben von:
sizein SchnittstelleCollection<Double>- Angegeben von:
sizein SchnittstelleISizeProvider- Angegeben von:
sizein SchnittstelleSet<Double>- Angegeben von:
sizein KlasseAbstractCollection<Double>- Gibt zurück:
- the size of the implementing Collection
-
clear
public void clear()- Angegeben von:
clearin SchnittstelleCollection<Double>- Angegeben von:
clearin SchnittstelleSet<Double>- Setzt außer Kraft:
clearin KlasseAbstractCollection<Double>
-
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 KlasseAbstractDoubleCollection- 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 KlasseAbstractCollection<Double>
-
toArray
Veraltet.- Angegeben von:
toArrayin SchnittstelleCollection<Double>- Angegeben von:
toArrayin SchnittstelleSet<Double>- Setzt außer Kraft:
toArrayin KlasseAbstractCollection<Double>
-
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 SchnittstelleDoubleNavigableSet- Angegeben von:
copyin SchnittstelleDoubleSet- Angegeben von:
copyin SchnittstelleDoubleSortedSet- Setzt außer Kraft:
copyin KlasseAbstractDoubleSet- Gibt zurück:
- a Shallow Copy of the collection
-
comparator
Beschreibung aus Schnittstelle kopiert:DoubleSortedSetA Type Specific Comparator method- Angegeben von:
comparatorin SchnittstelleDoubleSortedSet- Angegeben von:
comparatorin SchnittstelleSortedSet<Double>- Gibt zurück:
- the type specific comparator
-
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 SchnittstelleDoubleNavigableSet- Angegeben von:
iteratorin SchnittstelleDoubleSet- Angegeben von:
iteratorin SchnittstelleDoubleSortedSet- Angegeben von:
iteratorin SchnittstelleIterable<Double>- Angegeben von:
iteratorin SchnittstelleNavigableSet<Double>- Angegeben von:
iteratorin SchnittstelleSet<Double>- Angegeben von:
iteratorin KlasseAbstractDoubleSet- Gibt zurück:
- a iterator of the collection
- Siehe auch:
-
iterator
Beschreibung aus Schnittstelle kopiert:DoubleSortedSetA type Specific Iterator starting from a given key- Angegeben von:
iteratorin SchnittstelleDoubleSortedSet- Parameter:
fromElement- the element the iterator should start from- Gibt zurück:
- a iterator starting from the given element
-
descendingIterator
- Angegeben von:
descendingIteratorin SchnittstelleDoubleNavigableSet- Angegeben von:
descendingIteratorin SchnittstelleNavigableSet<Double>- Gibt zurück:
- a Type Specific desendingIterator
-
subSet
public DoubleNavigableSet subSet(double fromElement, boolean fromInclusive, double toElement, boolean toInclusive) Beschreibung aus Schnittstelle kopiert:DoubleNavigableSetA Type Specific SubSet method to reduce boxing/unboxing- Angegeben von:
subSetin SchnittstelleDoubleNavigableSet- Parameter:
fromElement- where the SubSet should startfromInclusive- if the fromElement is inclusive or nottoElement- where the SubSet should endtoInclusive- if the toElement is inclusive or not- Gibt zurück:
- a SubSet that is within the range of the desired range
-
headSet
Beschreibung aus Schnittstelle kopiert:DoubleNavigableSetA Type Specific HeadSet method to reduce boxing/unboxing- Angegeben von:
headSetin SchnittstelleDoubleNavigableSet- Parameter:
toElement- where the HeadSet should endinclusive- if the toElement is inclusive or not- Gibt zurück:
- a HeadSet that is within the range of the desired range
-
tailSet
Beschreibung aus Schnittstelle kopiert:DoubleNavigableSetA Type Specific TailSet method to reduce boxing/unboxing- Angegeben von:
tailSetin SchnittstelleDoubleNavigableSet- Parameter:
fromElement- where the TailSet should startinclusive- if the fromElement is inclusive or not- Gibt zurück:
- a TailSet that is within the range of the desired range
-
descendingSet
- Angegeben von:
descendingSetin SchnittstelleDoubleNavigableSet- Angegeben von:
descendingSetin SchnittstelleNavigableSet<Double>- Gibt zurück:
- a Type Specific desendingSet
-