Modul speiger.src.collections
Klasse ImmutableDoubleList
java.lang.Object
java.util.AbstractCollection<Double>
speiger.src.collections.doubles.collections.AbstractDoubleCollection
speiger.src.collections.doubles.lists.AbstractDoubleList
speiger.src.collections.doubles.lists.ImmutableDoubleList
- Alle implementierten Schnittstellen:
Iterable<Double>,Collection<Double>,List<Double>,DoubleCollection,DoubleIterable,DoubleList,ISizeProvider
A Type-Specific Immutable implementation of list that is written to reduce (un)boxing
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen speiger.src.collections.utils.ISizeProvider
ISizeProvider.CollectionSize -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungImmutableDoubleList(double... a) Creates a new Immutable copy of the contents of the Array.ImmutableDoubleList(double[] a, int length) Creates a new ImmutableList copy of the array with a custom lengthImmutableDoubleList(double[] a, int offset, int length) Creates a new ImmutableList copy of the array with in the custom range.ImmutableDoubleList(Collection<? extends Double> c) Veraltet.Creates a new Immutable copy of the contents of the Collection.Creates a new Immutable copy of the contents of the List. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanadd(double e) A Type-Specific implementation of add function that delegates toList.add(int, Object)voidadd(int index, double e) A Type-Specific add Function to reduce (un)boxingbooleanaddAll(double[] e, int offset, int length) A Type-Specific Array based addAll method to reduce the amount of WrappingbooleanaddAll(int index, Collection<? extends Double> c) Veraltet.booleanaddAll(int index, DoubleCollection c) A Type-Specific addAll Function to reduce (un)boxingbooleanaddAll(int index, DoubleList c) A Type-Specific and optimized addAll function that allows a faster transfer of elementsvoidaddElements(int from, double[] a, int offset, int length) A function to fast add elements to the listvoidclear()booleancontains(double e) A Type Specific implementation of the Collection#contains function.booleanVeraltet.copy()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.double[]extractElements(int from, int to) A function to fast extract elements out of the list, this removes the elements that were fetched.doublefindFirst(DoublePredicate filter) Helper function to reduce stream usage that allows to filter for the first match.<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)boxingdoublegetDouble(int index) A Type-Specific get function to reduce (un)boxingdouble[]getElements(int from, double[] a, int offset, int length) A function to fast fetch elements from the listintindexOf(double e) A Type-Specific function to find the index of a given elementintVeraltet.intlastIndexOf(double e) A Type-Specific function to find the last index of a given elementintVeraltet.listIterator(int index) A Type-Specific Iterator of listIteratorbooleanmatchesAll(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.Returns a Java-Type-Specific Stream to reduce boxing/unboxing.doublereduce(double identity, DoubleDoubleUnaryOperator operator) Performs a reduction on the elements of this Iterabledoublereduce(DoubleDoubleUnaryOperator operator) Performs a reduction on the elements of this IterablebooleanremDouble(double type) A Type-Specific implementation of remove.booleanremIf(DoublePredicate filter) A Type-Specific removeIf function to reduce (un)boxing.booleanremoveAll(Collection<?> c) Veraltet.booleanA Type-Specific implementation of removeAll.booleanA Type-Specific removeAll function that reduces (un)boxing.doubleremoveDouble(int index) A Type-Specific remove function to reduce (un)boxingvoidremoveElements(int from, int to) a function to fast remove elements from the list.booleanVeraltet.voidVeraltet.voidA Type-Specific replace function to reduce (un)boxingbooleanretainAll(Collection<?> c) Veraltet.booleanA Type-Specific implementation of retainAll.booleanA Type-Specific retainAll function that reduces (un)boxing.doubleset(int index, double e) A Type-Specific set function to reduce (un)boxingintsize()A function to return the size of the listvoidsize(int size) A function to ensure the elements are within the requested size.voidSorts the elements specified by the Natural order either by using the Comparator or the elementsA Type Specific Type Splititerator to reduce boxing/unboxingdoubleswapRemove(int index) A Highly Optimized remove function that removes the desired element.Object[]toArray()Veraltet.<E> E[]toArray(E[] a) Veraltet.double[]toDoubleArray(double[] a) A Type-Specific implementation of toArray.voidSorts the elements specified by the Natural order either by using the Comparator or the elements using a unstable sortVon Klasse geerbte Methoden speiger.src.collections.doubles.lists.AbstractDoubleList
add, addAll, addAll, addAll, equals, hashCode, indexedIterator, indexedIterator, iterator, listIterator, reversed, subList, swapRemoveDoubleVon Klasse geerbte Methoden speiger.src.collections.doubles.collections.AbstractDoubleCollection
add, containsAll, containsAll, containsAny, containsAny, remove, toDoubleArrayVon Klasse geerbte Methoden java.util.AbstractCollection
isEmpty, toStringVon Schnittstelle geerbte Methoden java.util.Collection
parallelStream, stream, toArrayVon Schnittstelle geerbte Methoden speiger.src.collections.doubles.collections.DoubleCollection
addAll, addAll, containsAll, containsAny, containsAny, parallelPrimitiveStream, pour, 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.lists.DoubleList
add, addElements, addElements, addIfAbsent, addIfPresent, fillBuffer, forEachIndexed, get, getElements, getFirstDouble, getLastDouble, remove, remove, removeFirstDouble, removeLastDouble, set, sort, synchronize, synchronize, unmodifiable, unstableSortVon Schnittstelle geerbte Methoden java.util.List
containsAll, isEmpty
-
Konstruktordetails
-
ImmutableDoubleList
Veraltet.Creates a new Immutable copy of the contents of the Collection.- Parameter:
c- the elements that should be added into the list
-
ImmutableDoubleList
Creates a new Immutable copy of the contents of the Collection.- Parameter:
c- the elements that should be added into the list
-
ImmutableDoubleList
Creates a new Immutable copy of the contents of the List.- Parameter:
l- the elements that should be added into the list
-
ImmutableDoubleList
public ImmutableDoubleList(double... a) Creates a new Immutable copy of the contents of the Array.- Parameter:
a- the array that should be copied
-
ImmutableDoubleList
public ImmutableDoubleList(double[] a, int length) Creates a new ImmutableList copy of the array with a custom length- Parameter:
a- the array that should be copiedlength- the desired length that should be copied
-
ImmutableDoubleList
public ImmutableDoubleList(double[] a, int offset, int length) Creates a new ImmutableList copy of the array with in the custom range.- Parameter:
a- the array that should be copiedoffset- the starting offset of where the array should be copied fromlength- the desired length that should be copied- Löst aus:
IllegalStateException- if offset is smaller then 0IllegalStateException- if the offset + length exceeds the array length
-
-
Methodendetails
-
add
public boolean add(double e) Beschreibung aus Klasse kopiert:AbstractDoubleListA Type-Specific implementation of add function that delegates toList.add(int, Object)- Angegeben von:
addin SchnittstelleDoubleCollection- Angegeben von:
addin SchnittstelleDoubleList- Setzt außer Kraft:
addin KlasseAbstractDoubleList- Parameter:
e- the element to add- Gibt zurück:
- true if the list was modified
- Siehe auch:
-
add
public void add(int index, double e) Beschreibung aus Schnittstelle kopiert:DoubleListA Type-Specific add Function to reduce (un)boxing- Parameter:
index- index at which the specified element is to be insertede- the element to add- Siehe auch:
-
addAll
Veraltet. -
addAll
Beschreibung aus Schnittstelle kopiert:DoubleListA Type-Specific addAll Function to reduce (un)boxing- Parameter:
index- index at which the specified elements is to be insertedc- the elements that need to be added- Gibt zurück:
- true if the list was modified
- Siehe auch:
-
addAll
Beschreibung aus Schnittstelle kopiert:DoubleListA Type-Specific and optimized addAll function that allows a faster transfer of elements- Parameter:
index- index at which the specified elements is to be insertedc- the elements that need to be added- Gibt zurück:
- true if the list was modified
-
addAll
public boolean addAll(double[] e, int offset, int length) Beschreibung aus Schnittstelle kopiert:DoubleCollectionA Type-Specific Array based addAll method to reduce the amount of Wrapping- Parameter:
e- the elements that should be addedoffset- where to start within the arraylength- how many elements of the array should be added- Gibt zurück:
- if the collection was modified
-
addElements
public void addElements(int from, double[] a, int offset, int length) Beschreibung aus Schnittstelle kopiert:DoubleListA function to fast add elements to the list- Parameter:
from- the index where the elements should be added into the lista- the elements that should be addedoffset- the start index of the array should be read fromlength- how many elements should be read from
-
getElements
public double[] getElements(int from, double[] a, int offset, int length) Beschreibung aus Schnittstelle kopiert:DoubleListA function to fast fetch elements from the list- Parameter:
from- index where the list should be fetching elements froma- the array where the values should be inserted tooffset- the startIndex of where the array should be written tolength- the number of elements the values should be fetched from- Gibt zurück:
- the inputArray
-
removeElements
public void removeElements(int from, int to) Beschreibung aus Schnittstelle kopiert:DoubleLista function to fast remove elements from the list.- Parameter:
from- the start index of where the elements should be removed from (inclusive)to- the end index of where the elements should be removed to (exclusive)
-
extractElements
public double[] extractElements(int from, int to) Beschreibung aus Schnittstelle kopiert:DoubleListA function to fast extract elements out of the list, this removes the elements that were fetched.- Parameter:
from- the start index of where the elements should be fetched from (inclusive)to- the end index of where the elements should be fetched to (exclusive)- Gibt zurück:
- a array of the elements that were fetched
-
contains
Veraltet.A function to find if the Element is present in this list.- Angegeben von:
containsin SchnittstelleCollection<Double>- Angegeben von:
containsin SchnittstelleDoubleCollection- Angegeben von:
containsin SchnittstelleDoubleList- Angegeben von:
containsin SchnittstelleList<Double>- Setzt außer Kraft:
containsin KlasseAbstractDoubleCollection- Parameter:
o- the element that is searched for- Gibt zurück:
- if the element was found.
-
indexOf
Veraltet.A function to find the index of a given element- Angegeben von:
indexOfin SchnittstelleDoubleList- Angegeben von:
indexOfin SchnittstelleList<Double>- Setzt außer Kraft:
indexOfin KlasseAbstractDoubleList- Parameter:
o- the element that is searched for- Gibt zurück:
- the index of the element if found. (if not found then -1)
-
lastIndexOf
Veraltet.A function to find the last index of a given element- Angegeben von:
lastIndexOfin SchnittstelleDoubleList- Angegeben von:
lastIndexOfin SchnittstelleList<Double>- Setzt außer Kraft:
lastIndexOfin KlasseAbstractDoubleList- Parameter:
o- the element that is searched for- Gibt zurück:
- the last index of the element if found. (if not found then -1)
-
contains
public boolean contains(double e) A Type Specific implementation of the Collection#contains function.- Angegeben von:
containsin SchnittstelleDoubleCollection- Setzt außer Kraft:
containsin KlasseAbstractDoubleCollection- Parameter:
e- the element that is searched for.- Gibt zurück:
- if the element was found
-
indexOf
public int indexOf(double e) A Type-Specific function to find the index of a given element- Angegeben von:
indexOfin SchnittstelleDoubleList- Setzt außer Kraft:
indexOfin KlasseAbstractDoubleList- Parameter:
e- the element that is searched for- Gibt zurück:
- the index of the element if found. (if not found then -1)
-
lastIndexOf
public int lastIndexOf(double e) A Type-Specific function to find the last index of a given element- Angegeben von:
lastIndexOfin SchnittstelleDoubleList- Setzt außer Kraft:
lastIndexOfin KlasseAbstractDoubleList- Parameter:
e- the element that is searched for- Gibt zurück:
- the last index of the element if found. (if not found then -1)
-
sort
Beschreibung aus Schnittstelle kopiert:DoubleListSorts the elements specified by the Natural order either by using the Comparator or the elements- Parameter:
c- the sorter of the elements, can be null- Siehe auch:
-
unstableSort
Beschreibung aus Schnittstelle kopiert:DoubleListSorts the elements specified by the Natural order either by using the Comparator or the elements using a unstable sort- Parameter:
c- the sorter of the elements, can be null- Siehe auch:
-
getDouble
public double getDouble(int index) A Type-Specific get function to reduce (un)boxing- Parameter:
index- the index of the element to fetch- Gibt zurück:
- the value of the requested index
- Löst aus:
IndexOutOfBoundsException- if the index is out of range- Siehe auch:
-
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 SchnittstelleDoubleList- Setzt außer Kraft:
copyin KlasseAbstractDoubleList- Gibt zurück:
- a Shallow Copy of the collection
-
forEach
A Type Specific foreach function that reduces (un)boxing- Parameter:
action- The action to be performed for each element- Löst aus:
NullPointerException- if the specified action is null- Siehe auch:
- ImplSpec:
The default implementation behaves as if:
for(int i = 0;i<size;i++) action.accept(data[i]);
-
forEach
Beschreibung aus Schnittstelle kopiert:DoubleIterableHelper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.- 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.- 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.- 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.- Parameter:
filter- that should be applied- Gibt zurück:
- true if all matches.
-
findFirst
Beschreibung aus Schnittstelle kopiert:DoubleIterableHelper function to reduce stream usage that allows to filter for the first match.- Parameter:
filter- that should be applied- Gibt zurück:
- the found value or the null equivalent variant.
-
reduce
Beschreibung aus Schnittstelle kopiert:DoubleIterablePerforms a reduction on the elements of this Iterable- 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- Parameter:
operator- the operation that should be applied- Gibt zurück:
- the reduction result, returns null value if nothing was found
-
count
Beschreibung aus Schnittstelle kopiert:DoubleIterableHelper function to reduce stream usage that allows to count the valid elements.- Parameter:
filter- that should be applied- Gibt zurück:
- the amount of Valid Elements
-
listIterator
Beschreibung aus Schnittstelle kopiert:DoubleListA Type-Specific Iterator of listIterator- Angegeben von:
listIteratorin SchnittstelleDoubleList- Angegeben von:
listIteratorin SchnittstelleList<Double>- Setzt außer Kraft:
listIteratorin KlasseAbstractDoubleList- Siehe auch:
-
set
public double set(int index, double e) Beschreibung aus Schnittstelle kopiert:DoubleListA Type-Specific set function to reduce (un)boxing- Parameter:
index- index of the element to replacee- element to be stored at the specified position- Gibt zurück:
- the element previously at the specified position
- Siehe auch:
-
replaceAll
Veraltet.Beschreibung aus Schnittstelle kopiert:DoubleListThis default implementation delegates to the corresponding type-specific function.
-
replaceDoubles
Beschreibung aus Schnittstelle kopiert:DoubleListA Type-Specific replace function to reduce (un)boxing- Parameter:
o- the action to replace the values
-
removeDouble
public double removeDouble(int index) Beschreibung aus Schnittstelle kopiert:DoubleListA Type-Specific remove function to reduce (un)boxing- Parameter:
index- the index of the element to be removed- Gibt zurück:
- the element previously at the specified position
- Siehe auch:
-
swapRemove
public double swapRemove(int index) Beschreibung aus Schnittstelle kopiert:DoubleListA Highly Optimized remove function that removes the desired element. But instead of shifting the elements to the left it moves the last element to the removed space.- Parameter:
index- the index of the element to be removed- Gibt zurück:
- the element previously at the specified position
-
remDouble
public boolean remDouble(double type) Beschreibung aus Klasse kopiert:AbstractDoubleCollectionA Type-Specific implementation of remove. This implementation iterates over the elements until it finds the element that is searched for or it runs out of elements. It stops after finding the first element- Angegeben von:
remDoublein SchnittstelleDoubleCollection- Setzt außer Kraft:
remDoublein KlasseAbstractDoubleCollection- Parameter:
type- the element that is searched for- Gibt zurück:
- true if the element was found and removed.
- Siehe auch:
-
removeAll
Veraltet.- Angegeben von:
removeAllin SchnittstelleCollection<Double>- Angegeben von:
removeAllin SchnittstelleList<Double>- Setzt außer Kraft:
removeAllin KlasseAbstractCollection<Double>
-
retainAll
Veraltet.- Angegeben von:
retainAllin SchnittstelleCollection<Double>- Angegeben von:
retainAllin SchnittstelleList<Double>- Setzt außer Kraft:
retainAllin KlasseAbstractCollection<Double>
-
removeIf
Veraltet.Beschreibung aus Schnittstelle kopiert:DoubleCollectionThis default implementation delegates to the corresponding type-specific function.
-
removeAll
Beschreibung aus Klasse kopiert:AbstractDoubleCollectionA Type-Specific implementation of removeAll. This Implementation iterates over all elements and removes them as they were found in the other collection.- Angegeben von:
removeAllin SchnittstelleDoubleCollection- Setzt außer Kraft:
removeAllin KlasseAbstractDoubleCollection- Parameter:
c- the elements that should be deleted- Gibt zurück:
- true if the collection was modified.
- Siehe auch:
-
retainAll
Beschreibung aus Klasse kopiert:AbstractDoubleCollectionA Type-Specific implementation of retainAll. This Implementation iterates over all elements and removes them as they were not found in the other collection.- Angegeben von:
retainAllin SchnittstelleDoubleCollection- Setzt außer Kraft:
retainAllin KlasseAbstractDoubleCollection- Parameter:
c- the elements that should be kept- Gibt zurück:
- true if the collection was modified.
- Siehe auch:
-
removeAll
Beschreibung aus Schnittstelle kopiert:DoubleCollectionA Type-Specific removeAll function that reduces (un)boxing. It also notifies the remover of which exact element is going to be removed.- Angegeben von:
removeAllin SchnittstelleDoubleCollection- Setzt außer Kraft:
removeAllin KlasseAbstractDoubleCollection- Parameter:
c- the collection of elements that should be removedr- elements that got removed- Gibt zurück:
- true if any element was removed
- Siehe auch:
-
retainAll
Beschreibung aus Schnittstelle kopiert:DoubleCollectionA Type-Specific retainAll function that reduces (un)boxing. It also notifies the remover of which exact element is going to be removed.- Angegeben von:
retainAllin SchnittstelleDoubleCollection- Setzt außer Kraft:
retainAllin KlasseAbstractDoubleCollection- Parameter:
c- the collection of elements that should be keptr- elements that got removed- Gibt zurück:
- true if any element was removed
- Siehe auch:
-
remIf
Beschreibung aus Schnittstelle kopiert:DoubleCollectionA Type-Specific removeIf function to reduce (un)boxing.Removes elements that were selected by the filter
- Parameter:
filter- Filters the elements that should be removed- Gibt zurück:
- true if the collection was modified
- Siehe auch:
-
toArray
Veraltet.A toArray implementation that ensures the Array itself is a Object.- Angegeben von:
toArrayin SchnittstelleCollection<Double>- Angegeben von:
toArrayin SchnittstelleList<Double>- Setzt außer Kraft:
toArrayin KlasseAbstractCollection<Double>- Gibt zurück:
- a Array of the elements in the list
-
toArray
Veraltet.A toArray implementation that ensures the Array itself is a Object.- Angegeben von:
toArrayin SchnittstelleCollection<Double>- Angegeben von:
toArrayin SchnittstelleList<Double>- Setzt außer Kraft:
toArrayin KlasseAbstractCollection<Double>- Parameter:
a- original array. If null a Object array with the right size is created. If to small the Array of the same type is created with the right size- Gibt zurück:
- a Array of the elements in the list
-
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:
-
size
public int size()A function to return the size of the list- Angegeben von:
sizein SchnittstelleCollection<Double>- Angegeben von:
sizein SchnittstelleISizeProvider- Angegeben von:
sizein SchnittstelleList<Double>- Angegeben von:
sizein KlasseAbstractCollection<Double>- Gibt zurück:
- the size of elements in the list
-
size
public void size(int size) Beschreibung aus Schnittstelle kopiert:DoubleListA function to ensure the elements are within the requested size. If smaller then the stored elements they get removed as needed. If bigger it is ensured that enough room is provided depending on the implementation- Angegeben von:
sizein SchnittstelleDoubleList- Setzt außer Kraft:
sizein KlasseAbstractDoubleList- Parameter:
size- the requested amount of elements/room for elements
-
clear
public void clear()- Angegeben von:
clearin SchnittstelleCollection<Double>- Angegeben von:
clearin SchnittstelleList<Double>- Setzt außer Kraft:
clearin KlasseAbstractCollection<Double>
-
primitiveStream
Returns a Java-Type-Specific Stream to reduce boxing/unboxing.- Gibt zurück:
- a Stream of the closest java type
- Note:
- characteristics are ordered, sized, subsized
-
spliterator
A Type Specific Type Splititerator to reduce boxing/unboxing- Gibt zurück:
- type specific splititerator
- Note:
- characteristics are ordered, sized, subsized
-