Modul speiger.src.collections
Klasse ObjectRBTreeSet<T>
java.lang.Object
java.util.AbstractCollection<T>
speiger.src.collections.objects.collections.AbstractObjectCollection<T>
speiger.src.collections.objects.sets.AbstractObjectSet<T>
speiger.src.collections.objects.sets.ObjectRBTreeSet<T>
- Typparameter:
T- the keyType of elements maintained by this Collection
- Alle implementierten Schnittstellen:
Iterable<T>,Collection<T>,NavigableSet<T>,Set<T>,SortedSet<T>,ObjectCollection<T>,ObjectIterable<T>,ObjectNavigableSet<T>,ObjectSet<T>,ObjectSortedSet<T>,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 ConstructorObjectRBTreeSet(Collection<? extends T> collection) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.ObjectRBTreeSet(Collection<? extends T> collection, Comparator<T> comp) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.ObjectRBTreeSet(Comparator<T> comp) Constructor that allows to define the sorterObjectRBTreeSet(Iterator<T> iterator) A Helper constructor that allows to create a set from a iterator of an unknown sizeObjectRBTreeSet(Iterator<T> iterator, Comparator<T> comp) A Helper constructor that allows to create a set from a iterator of an unknown sizeObjectRBTreeSet(ObjectCollection<T> collection) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.ObjectRBTreeSet(ObjectCollection<T> collection, Comparator<T> comp) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.ObjectRBTreeSet(ObjectIterator<T> iterator) A Helper constructor that allows to create a set from a iterator of an unknown sizeObjectRBTreeSet(ObjectIterator<T> iterator, Comparator<T> comp) A Helper constructor that allows to create a set from a iterator of an unknown sizeObjectRBTreeSet(ObjectSortedSet<T> sortedSet) A Helper constructor that allows to create a Set with exactly the same values as the provided SortedSet.ObjectRBTreeSet(T[] array) Helper constructor that allow to create a set from an arrayObjectRBTreeSet(T[] array, int offset, int length) Helper constructor that allow to create a set from an arrayObjectRBTreeSet(T[] array, int offset, int length, Comparator<T> comp) Helper constructor that allow to create a set from an arrayObjectRBTreeSet(T[] array, Comparator<T> comp) Helper constructor that allow to create a set from an array -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanA Helper method that allows to add a element or getting the already present implement.voidclear()A Type Specific Comparator methodbooleancopy()A Function that does a shallow clone of the Collection itself.intHelper function to reduce stream usage that allows to count the valid elements.Helper function to reduce stream usage that allows to filter for the first match.first()<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.voidvoidforEachIndexed(IntObjectConsumer<T> action) A Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.only used for primitivesonly used for primitivesiterator()Returns a Type-Specific Iterator to reduce (un)boxingA type Specific Iterator starting from a given keylast()booleanmatchesAll(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.A method to get and remove the first element in the setpollLast()A method to get and remove the last element in the set<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 Iterablebooleanintsize()Object[]toArray()Veraltet.<E> E[]toArray(E[] a) Von Klasse geerbte Methoden speiger.src.collections.objects.sets.AbstractObjectSet
equals, hashCodeVon Klasse geerbte Methoden speiger.src.collections.objects.collections.AbstractObjectCollection
addAll, containsAll, containsAll, containsAny, containsAny, removeAll, removeAll, retainAll, retainAllVon Klasse geerbte Methoden java.util.AbstractCollection
addAll, isEmpty, removeAll, retainAll, toStringVon Schnittstelle geerbte Methoden java.util.Collection
parallelStream, removeIf, streamVon Schnittstelle geerbte Methoden speiger.src.collections.objects.collections.ObjectCollection
addAll, addAll, addAll, addAll, containsAll, containsAny, containsAny, pour, removeAll, removeAll, retainAll, retainAll, spliterator, 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.sets.ObjectNavigableSet
headSet, spliterator, subSet, synchronize, synchronize, tailSet, unmodifiable
-
Konstruktordetails
-
ObjectRBTreeSet
public ObjectRBTreeSet()Default Constructor -
ObjectRBTreeSet
Constructor that allows to define the sorter- Parameter:
comp- the function that decides how the tree is sorted, can be null
-
ObjectRBTreeSet
Helper constructor that allow to create a set from an array- Parameter:
array- the elements that should be used
-
ObjectRBTreeSet
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
-
ObjectRBTreeSet
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
-
ObjectRBTreeSet
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
-
ObjectRBTreeSet
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
-
ObjectRBTreeSet
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
-
ObjectRBTreeSet
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
-
ObjectRBTreeSet
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
-
ObjectRBTreeSet
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
-
ObjectRBTreeSet
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
-
ObjectRBTreeSet
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
-
ObjectRBTreeSet
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
-
ObjectRBTreeSet
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
-
getDefaultMaxValue
only used for primitives- Gibt zurück:
- null
-
getDefaultMinValue
only used for primitives- Gibt zurück:
- null
-
add
- Angegeben von:
addin SchnittstelleCollection<T>- Angegeben von:
addin SchnittstelleSet<T>- Setzt außer Kraft:
addin KlasseAbstractCollection<T>
-
addOrGet
Beschreibung aus Schnittstelle kopiert:ObjectSetA Helper method that allows to add a element or getting the already present implement. Allowing to make unique references reuseable. -
lower
- Angegeben von:
lowerin SchnittstelleNavigableSet<T>
-
floor
- Angegeben von:
floorin SchnittstelleNavigableSet<T>
-
higher
- Angegeben von:
higherin SchnittstelleNavigableSet<T>
-
ceiling
- Angegeben von:
ceilingin SchnittstelleNavigableSet<T>
-
forEach
-
forEachIndexed
Beschreibung aus Schnittstelle kopiert:ObjectIterableA Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.- Angegeben von:
forEachIndexedin SchnittstelleObjectIterable<T>- Parameter:
action- The action to be performed for each element
-
forEach
Beschreibung aus Schnittstelle kopiert:ObjectIterableHelper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.- Angegeben von:
forEachin SchnittstelleObjectIterable<T>- 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.- Angegeben von:
matchesAnyin SchnittstelleObjectIterable<T>- 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.- Angegeben von:
matchesNonein SchnittstelleObjectIterable<T>- 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.- Angegeben von:
matchesAllin SchnittstelleObjectIterable<T>- Parameter:
filter- that should be applied- Gibt zurück:
- true if all matches.
-
reduce
Beschreibung aus Schnittstelle kopiert:ObjectIterablePerforms a reduction on the elements of this Iterable- Angegeben von:
reducein SchnittstelleObjectIterable<T>- 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- Angegeben von:
reducein SchnittstelleObjectIterable<T>- 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:ObjectIterableHelper function to reduce stream usage that allows to filter for the first match.- Angegeben von:
findFirstin SchnittstelleObjectIterable<T>- Parameter:
filter- that should be applied- Gibt zurück:
- the found value or the null equivalent variant.
-
count
Beschreibung aus Schnittstelle kopiert:ObjectIterableHelper function to reduce stream usage that allows to count the valid elements.- Angegeben von:
countin SchnittstelleObjectIterable<T>- Parameter:
filter- that should be applied- Gibt zurück:
- the amount of Valid Elements
-
contains
- Angegeben von:
containsin SchnittstelleCollection<T>- Angegeben von:
containsin SchnittstelleSet<T>- Setzt außer Kraft:
containsin KlasseAbstractCollection<T>
-
first
-
last
-
remove
- Angegeben von:
removein SchnittstelleCollection<T>- Angegeben von:
removein SchnittstelleSet<T>- Setzt außer Kraft:
removein KlasseAbstractCollection<T>
-
pollFirst
Beschreibung aus Schnittstelle kopiert:ObjectSortedSetA method to get and remove the first element in the set- Angegeben von:
pollFirstin SchnittstelleNavigableSet<T>- Angegeben von:
pollFirstin SchnittstelleObjectSortedSet<T>- Gibt zurück:
- first element in the set
-
pollLast
Beschreibung aus Schnittstelle kopiert:ObjectSortedSetA method to get and remove the last element in the set- Angegeben von:
pollLastin SchnittstelleNavigableSet<T>- Angegeben von:
pollLastin SchnittstelleObjectSortedSet<T>- Gibt zurück:
- last element in the set
-
size
public int size()- Angegeben von:
sizein SchnittstelleCollection<T>- Angegeben von:
sizein SchnittstelleISizeProvider- Angegeben von:
sizein SchnittstelleSet<T>- Angegeben von:
sizein KlasseAbstractCollection<T>- Gibt zurück:
- the size of the implementing Collection
-
clear
public void clear()- Angegeben von:
clearin SchnittstelleCollection<T>- Angegeben von:
clearin SchnittstelleSet<T>- Setzt außer Kraft:
clearin KlasseAbstractCollection<T>
-
toArray
Veraltet.- Angegeben von:
toArrayin SchnittstelleCollection<T>- Angegeben von:
toArrayin SchnittstelleSet<T>- Setzt außer Kraft:
toArrayin KlasseAbstractCollection<T>
-
toArray
public <E> E[] toArray(E[] a) - Angegeben von:
toArrayin SchnittstelleCollection<T>- Angegeben von:
toArrayin SchnittstelleSet<T>- Setzt außer Kraft:
toArrayin KlasseAbstractCollection<T>
-
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 SchnittstelleObjectNavigableSet<T>- Angegeben von:
copyin SchnittstelleObjectSet<T>- Angegeben von:
copyin SchnittstelleObjectSortedSet<T>- Setzt außer Kraft:
copyin KlasseAbstractObjectSet<T>- Gibt zurück:
- a Shallow Copy of the collection
-
comparator
Beschreibung aus Schnittstelle kopiert:ObjectSortedSetA Type Specific Comparator method- Angegeben von:
comparatorin SchnittstelleObjectSortedSet<T>- Angegeben von:
comparatorin SchnittstelleSortedSet<T>- Gibt zurück:
- the type specific comparator
-
iterator
Beschreibung aus Schnittstelle kopiert:ObjectCollectionReturns a Type-Specific Iterator to reduce (un)boxing- Angegeben von:
iteratorin SchnittstelleCollection<T>- Angegeben von:
iteratorin SchnittstelleIterable<T>- Angegeben von:
iteratorin SchnittstelleNavigableSet<T>- Angegeben von:
iteratorin SchnittstelleObjectCollection<T>- Angegeben von:
iteratorin SchnittstelleObjectIterable<T>- Angegeben von:
iteratorin SchnittstelleObjectNavigableSet<T>- Angegeben von:
iteratorin SchnittstelleObjectSet<T>- Angegeben von:
iteratorin SchnittstelleObjectSortedSet<T>- Angegeben von:
iteratorin SchnittstelleSet<T>- Angegeben von:
iteratorin KlasseAbstractObjectSet<T>- Gibt zurück:
- a iterator of the collection
- Siehe auch:
-
iterator
Beschreibung aus Schnittstelle kopiert:ObjectSortedSetA type Specific Iterator starting from a given key- Angegeben von:
iteratorin SchnittstelleObjectSortedSet<T>- Parameter:
fromElement- the element the iterator should start from- Gibt zurück:
- a iterator starting from the given element
-
descendingIterator
- Angegeben von:
descendingIteratorin SchnittstelleNavigableSet<T>- Angegeben von:
descendingIteratorin SchnittstelleObjectNavigableSet<T>- Gibt zurück:
- a Type Specific desendingIterator
-
subSet
public ObjectNavigableSet<T> subSet(T fromElement, boolean fromInclusive, T toElement, boolean toInclusive) - Angegeben von:
subSetin SchnittstelleNavigableSet<T>- Angegeben von:
subSetin SchnittstelleObjectNavigableSet<T>
-
headSet
- Angegeben von:
headSetin SchnittstelleNavigableSet<T>- Angegeben von:
headSetin SchnittstelleObjectNavigableSet<T>
-
tailSet
- Angegeben von:
tailSetin SchnittstelleNavigableSet<T>- Angegeben von:
tailSetin SchnittstelleObjectNavigableSet<T>
-
descendingSet
- Angegeben von:
descendingSetin SchnittstelleNavigableSet<T>- Angegeben von:
descendingSetin SchnittstelleObjectNavigableSet<T>- Gibt zurück:
- a Type Specific desendingSet
-