Modul speiger.src.collections
Klasse ImmutableObjectList<T>
java.lang.Object
java.util.AbstractCollection<T>
speiger.src.collections.objects.collections.AbstractObjectCollection<T>
speiger.src.collections.objects.lists.AbstractObjectList<T>
speiger.src.collections.objects.lists.ImmutableObjectList<T>
- Typparameter:
T- the keyType of elements maintained by this Collection
- Alle implementierten Schnittstellen:
Iterable<T>,Collection<T>,List<T>,ObjectCollection<T>,ObjectIterable<T>,ObjectList<T>,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
KonstruktorenKonstruktorBeschreibungImmutableObjectList(Collection<? extends T> c) Creates a new Immutable copy of the contents of the Collection.Creates a new Immutable copy of the contents of the Collection.Creates a new Immutable copy of the contents of the List.ImmutableObjectList(T... a) Creates a new Immutable copy of the contents of the Array.ImmutableObjectList(T[] a, int length) Creates a new ImmutableList copy of the array with a custom lengthImmutableObjectList(T[] a, int offset, int length) Creates a new ImmutableList copy of the array with in the custom range. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidbooleanA Type-Specific implementation of add function that delegates toList.add(int, Object)booleanaddAll(int index, Collection<? extends T> c) booleanaddAll(int index, ObjectCollection<T> c) A Type-Specific addAll Function to reduce (un)boxingbooleanaddAll(int index, ObjectList<T> c) A Type-Specific and optimized addAll function that allows a faster transfer of elementsbooleanA Type-Specific Array based addAll method to reduce the amount of WrappingvoidaddElements(int from, T[] a, int offset, int length) A function to fast add elements to the listvoidclear()booleanA function to find if the Element is present in this list.copy()A Function that does a shallow clone of the Collection itself.intHelper function to reduce stream usage that allows to count the valid elements.<K> K[]extractElements(int from, int to, Class<K> type) A function to fast extract elements out of the list, this removes the elements that were fetched.Helper function to reduce stream usage that allows to filter for the first match.<E> voidforEach(E input, ObjectObjectConsumer<E, T> action) Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.voidA Type Specific foreach function that reduces (un)boxingget(int index) A Type-Specific get function to reduce (un)boxingT[]getElements(int from, T[] a, int offset, int length) A function to fast fetch elements from the listintA function to find the index of a given elementintA function to find the last index of a given elementlistIterator(int index) A Type-Specific Iterator of listIteratorbooleanmatchesAll(Predicate<T> filter) Helper function to reduce stream usage that allows to filter for all matches.booleanmatchesAny(Predicate<T> filter) Helper function to reduce stream usage that allows to filter for any matches.booleanmatchesNone(Predicate<T> filter) Helper function to reduce stream usage that allows to filter for no matches.<E> Ereduce(E identity, BiFunction<E, T, E> operator) Performs a reduction on the elements of this Iterablereduce(ObjectObjectUnaryOperator<T, T> operator) Performs a reduction on the elements of this Iterableremove(int index) booleanremoveAll(Collection<?> c) booleanA Type-Specific implementation of removeAll.booleanremoveAll(ObjectCollection<T> c, Consumer<T> r) A Type-Specific removeAll function that reduces (un)boxing.voidremoveElements(int from, int to) a function to fast remove elements from the list.booleanvoidreplaceAll(UnaryOperator<T> o) A function to replace all values in the listbooleanretainAll(Collection<?> c) booleanA Type-Specific implementation of retainAll.booleanretainAll(ObjectCollection<T> c, Consumer<T> r) A Type-Specific retainAll function that reduces (un)boxing.intsize()A function to return the size of the listvoidsize(int size) A function to ensure the elements are within the requested size.voidsort(Comparator<? super T> c) Sorts the elements specified by the Natural order either by using the Comparator or the elementsA Type Specific Type Splititerator to reduce boxing/unboxingswapRemove(int index) A Highly Optimized remove function that removes the desired element.Object[]toArray()A toArray implementation that ensures the Array itself is a Object.<E> E[]toArray(E[] a) A toArray implementation that ensures the Array itself is a Object.voidunstableSort(Comparator<? super T> c) Sorts 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.objects.lists.AbstractObjectList
addAll, addAll, addAll, equals, hashCode, indexedIterator, indexedIterator, iterator, listIterator, reversed, subList, swapRemoveVon Klasse geerbte Methoden speiger.src.collections.objects.collections.AbstractObjectCollection
containsAll, containsAll, containsAny, containsAnyVon Klasse geerbte Methoden java.util.AbstractCollection
isEmpty, remove, toStringVon Schnittstelle geerbte Methoden java.util.Collection
parallelStream, streamVon Schnittstelle geerbte Methoden java.util.List
containsAll, isEmpty, removeVon Schnittstelle geerbte Methoden speiger.src.collections.objects.collections.ObjectCollection
addAll, addAll, containsAll, containsAny, containsAny, pour, toArrayVon Schnittstelle geerbte Methoden speiger.src.collections.objects.collections.ObjectIterable
arrayflatMap, asAsync, distinct, filter, flatMap, limit, map, mapToBoolean, mapToByte, mapToDouble, mapToFloat, mapToInt, mapToLong, mapToShort, peek, pourAsList, pourAsSet, repeat, sortedVon Schnittstelle geerbte Methoden speiger.src.collections.objects.lists.ObjectList
addElements, addElements, addIfAbsent, addIfPresent, forEachIndexed, getElements, getFirst, getLast, removeFirst, removeLast, synchronize, synchronize, unmodifiable
-
Konstruktordetails
-
ImmutableObjectList
Creates a new Immutable copy of the contents of the Collection.- Parameter:
c- the elements that should be added into the list
-
ImmutableObjectList
Creates a new Immutable copy of the contents of the Collection.- Parameter:
c- the elements that should be added into the list
-
ImmutableObjectList
Creates a new Immutable copy of the contents of the List.- Parameter:
l- the elements that should be added into the list
-
ImmutableObjectList
Creates a new Immutable copy of the contents of the Array.- Parameter:
a- the array that should be copied
-
ImmutableObjectList
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
-
ImmutableObjectList
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
Beschreibung aus Klasse kopiert:AbstractObjectListA Type-Specific implementation of add function that delegates toList.add(int, Object)- Angegeben von:
addin SchnittstelleCollection<T>- Angegeben von:
addin SchnittstelleList<T>- Setzt außer Kraft:
addin KlasseAbstractObjectList<T>
-
add
-
addAll
-
addAll
Beschreibung aus Schnittstelle kopiert:ObjectListA 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:ObjectListA 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
Beschreibung aus Schnittstelle kopiert:ObjectCollectionA 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
Beschreibung aus Schnittstelle kopiert:ObjectListA 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
Beschreibung aus Schnittstelle kopiert:ObjectListA 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:ObjectLista 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
Beschreibung aus Schnittstelle kopiert:ObjectListA function to fast extract elements out of the list, this removes the elements that were fetched.- Typparameter:
K- the keyType of elements maintained by this Collection- 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)type- the type of the OutputArray- Gibt zurück:
- a array of the elements that were fetched
-
contains
A function to find if the Element is present in this list.- Angegeben von:
containsin SchnittstelleCollection<T>- Angegeben von:
containsin SchnittstelleList<T>- Setzt außer Kraft:
containsin KlasseAbstractCollection<T>- Parameter:
o- the element that is searched for- Gibt zurück:
- if the element was found.
-
indexOf
A function to find the index of a given element -
lastIndexOf
A function to find the last index of a given element- Angegeben von:
lastIndexOfin SchnittstelleList<T>- Setzt außer Kraft:
lastIndexOfin KlasseAbstractObjectList<T>- Parameter:
o- 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:ObjectListSorts the elements specified by the Natural order either by using the Comparator or the elements- Siehe auch:
-
unstableSort
Beschreibung aus Schnittstelle kopiert:ObjectListSorts 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:
-
get
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
-
copy
Beschreibung aus Schnittstelle kopiert:ObjectCollectionA 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 SchnittstelleObjectCollection<T>- Angegeben von:
copyin SchnittstelleObjectList<T>- Setzt außer Kraft:
copyin KlasseAbstractObjectList<T>- 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:ObjectIterableHelper 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:ObjectIterableHelper 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:ObjectIterableHelper 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:ObjectIterableHelper 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:ObjectIterableHelper 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:ObjectIterablePerforms a reduction on the elements of this Iterable- Typparameter:
E- the keyType of elements maintained by this Collection- 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:ObjectIterablePerforms 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:ObjectIterableHelper 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:ObjectListA Type-Specific Iterator of listIterator- Angegeben von:
listIteratorin SchnittstelleList<T>- Angegeben von:
listIteratorin SchnittstelleObjectList<T>- Setzt außer Kraft:
listIteratorin KlasseAbstractObjectList<T>- Siehe auch:
-
set
-
replaceAll
Beschreibung aus Schnittstelle kopiert:ObjectListA function to replace all values in the list- Parameter:
o- the action to replace the values
-
remove
-
swapRemove
Beschreibung aus Schnittstelle kopiert:ObjectListA 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
-
removeAll
- Angegeben von:
removeAllin SchnittstelleCollection<T>- Angegeben von:
removeAllin SchnittstelleList<T>- Setzt außer Kraft:
removeAllin KlasseAbstractCollection<T>
-
retainAll
- Angegeben von:
retainAllin SchnittstelleCollection<T>- Angegeben von:
retainAllin SchnittstelleList<T>- Setzt außer Kraft:
retainAllin KlasseAbstractCollection<T>
-
removeIf
-
removeAll
Beschreibung aus Klasse kopiert:AbstractObjectCollectionA 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 SchnittstelleObjectCollection<T>- Setzt außer Kraft:
removeAllin KlasseAbstractObjectCollection<T>- Parameter:
c- the elements that should be deleted- Gibt zurück:
- true if the collection was modified.
- Siehe auch:
-
retainAll
Beschreibung aus Klasse kopiert:AbstractObjectCollectionA 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 SchnittstelleObjectCollection<T>- Setzt außer Kraft:
retainAllin KlasseAbstractObjectCollection<T>- Parameter:
c- the elements that should be kept- Gibt zurück:
- true if the collection was modified.
- Siehe auch:
-
removeAll
Beschreibung aus Schnittstelle kopiert:ObjectCollectionA 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 SchnittstelleObjectCollection<T>- Setzt außer Kraft:
removeAllin KlasseAbstractObjectCollection<T>- 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:ObjectCollectionA 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 SchnittstelleObjectCollection<T>- Setzt außer Kraft:
retainAllin KlasseAbstractObjectCollection<T>- 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:
-
toArray
A toArray implementation that ensures the Array itself is a Object.- Angegeben von:
toArrayin SchnittstelleCollection<T>- Angegeben von:
toArrayin SchnittstelleList<T>- Setzt außer Kraft:
toArrayin KlasseAbstractCollection<T>- Gibt zurück:
- a Array of the elements in the list
-
toArray
public <E> E[] toArray(E[] a) A toArray implementation that ensures the Array itself is a Object.- Angegeben von:
toArrayin SchnittstelleCollection<T>- Angegeben von:
toArrayin SchnittstelleList<T>- Setzt außer Kraft:
toArrayin KlasseAbstractCollection<T>- 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
-
size
public int size()A function to return the size of the list- Angegeben von:
sizein SchnittstelleCollection<T>- Angegeben von:
sizein SchnittstelleISizeProvider- Angegeben von:
sizein SchnittstelleList<T>- Angegeben von:
sizein KlasseAbstractCollection<T>- Gibt zurück:
- the size of elements in the list
-
size
public void size(int size) Beschreibung aus Schnittstelle kopiert:ObjectListA 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 SchnittstelleObjectList<T>- Setzt außer Kraft:
sizein KlasseAbstractObjectList<T>- Parameter:
size- the requested amount of elements/room for elements
-
clear
public void clear()- Angegeben von:
clearin SchnittstelleCollection<T>- Angegeben von:
clearin SchnittstelleList<T>- Setzt außer Kraft:
clearin KlasseAbstractCollection<T>
-
spliterator
A Type Specific Type Splititerator to reduce boxing/unboxing- Gibt zurück:
- type specific splititerator
- Note:
- characteristics are ordered, sized, subsized
-