java.lang.Object
java.util.AbstractCollection<Long>
speiger.src.collections.longs.collections.AbstractLongCollection
speiger.src.collections.longs.sets.AbstractLongSet
speiger.src.collections.longs.sets.LongRBTreeSet
- Alle implementierten Schnittstellen:
Iterable<Long>,Collection<Long>,NavigableSet<Long>,Set<Long>,SortedSet<Long>,LongCollection,LongIterable,LongNavigableSet,LongSet,LongSortedSet,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 ConstructorLongRBTreeSet(long[] array) Helper constructor that allow to create a set from an arrayLongRBTreeSet(long[] array, int offset, int length) Helper constructor that allow to create a set from an arrayLongRBTreeSet(long[] array, int offset, int length, LongComparator comp) Helper constructor that allow to create a set from an arrayLongRBTreeSet(long[] array, LongComparator comp) Helper constructor that allow to create a set from an arrayLongRBTreeSet(Collection<? extends Long> collection) Veraltet.LongRBTreeSet(Collection<? extends Long> collection, LongComparator comp) Veraltet.LongRBTreeSet(Iterator<Long> iterator) A Helper constructor that allows to create a set from a iterator of an unknown sizeLongRBTreeSet(Iterator<Long> iterator, LongComparator comp) A Helper constructor that allows to create a set from a iterator of an unknown sizeLongRBTreeSet(LongCollection collection) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.LongRBTreeSet(LongCollection collection, LongComparator comp) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.LongRBTreeSet(LongIterator iterator) A Helper constructor that allows to create a set from a iterator of an unknown sizeLongRBTreeSet(LongIterator iterator, LongComparator comp) A Helper constructor that allows to create a set from a iterator of an unknown sizeLongRBTreeSet(LongComparator comp) Constructor that allows to define the sorterLongRBTreeSet(LongSortedSet sortedSet) A Helper constructor that allows to create a Set with exactly the same values as the provided SortedSet. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanadd(long o) A Type-Specific add function to reduce (un)boxinglongceiling(long e) A Type Specific ceiling method to reduce boxing/unboxing.voidclear()A Type Specific Comparator methodbooleancontains(long e) A Type-Specific implementation of contains.booleancopy()A Function that does a shallow clone of the Collection itself.intcount(LongPredicate filter) Helper function to reduce stream usage that allows to count the valid elements.longfindFirst(LongPredicate filter) Helper function to reduce stream usage that allows to filter for the first match.longA method to get the first element in the setlongfloor(long e) A Type Specific floor method to reduce boxing/unboxing.<E> voidforEach(E input, ObjectLongConsumer<E> action) Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.voidforEach(LongConsumer action) A Type Specific foreach function that reduces (un)boxingvoidforEachIndexed(IntLongConsumer action) A Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.longA Helper method to get the max value for SubSets.longA Helper method to get the min value for SubSets.headSet(long toElement, boolean inclusive) A Type Specific HeadSet method to reduce boxing/unboxinglonghigher(long e) A Type Specific higher method to reduce boxing/unboxing.iterator()Returns a Type-Specific Iterator to reduce (un)boxingiterator(long fromElement) A type Specific Iterator starting from a given keylonglastLong()A method to get the last element in the setlonglower(long e) A Type Specific lower method to reduce boxing/unboxing.booleanmatchesAll(LongPredicate filter) Helper function to reduce stream usage that allows to filter for all matches.booleanmatchesAny(LongPredicate filter) Helper function to reduce stream usage that allows to filter for any matches.booleanmatchesNone(LongPredicate filter) Helper function to reduce stream usage that allows to filter for no matches.longA method to get and remove the first element in the setlongA method to get and remove the last element in the setlongreduce(long identity, LongLongUnaryOperator operator) Performs a reduction on the elements of this Iterablelongreduce(LongLongUnaryOperator operator) Performs a reduction on the elements of this Iterablebooleanremove(long o) A Type Specific remove function to reduce boxing/unboxingbooleanvoidsetDefaultMaxValue(long value) A Helper method to set the max value for SubSets.voidsetDefaultMinValue(long value) A Helper method to set the min value for SubSets.intsize()subSet(long fromElement, boolean fromInclusive, long toElement, boolean toInclusive) A Type Specific SubSet method to reduce boxing/unboxingtailSet(long fromElement, boolean inclusive) A Type Specific TailSet method to reduce boxing/unboxingObject[]toArray()Veraltet.<E> E[]toArray(E[] a) Veraltet.long[]toLongArray(long[] a) A Type-Specific implementation of toArray.Von Klasse geerbte Methoden speiger.src.collections.longs.sets.AbstractLongSet
equals, hashCodeVon Klasse geerbte Methoden speiger.src.collections.longs.collections.AbstractLongCollection
add, addAll, addAll, containsAll, containsAll, containsAny, containsAny, remLong, removeAll, removeAll, retainAll, retainAll, toLongArrayVon 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.longs.collections.LongCollection
addAll, addAll, addAll, addAll, containsAll, containsAny, containsAny, parallelPrimitiveStream, pour, primitiveStream, remIf, removeAll, removeAll, removeIf, retainAll, retainAll, spliterator, toLongArrayVon Schnittstelle geerbte Methoden speiger.src.collections.longs.collections.LongIterable
arrayflatMap, asAsync, distinct, filter, flatMap, forEach, limit, map, peek, pourAsList, pourAsSet, repeat, sortedVon Schnittstelle geerbte Methoden speiger.src.collections.longs.sets.LongNavigableSet
first, headSet, headSet, headSet, last, pollFirst, pollLast, spliterator, subSet, subSet, subSet, synchronize, synchronize, tailSet, tailSet, tailSet, unmodifiable
-
Konstruktordetails
-
LongRBTreeSet
public LongRBTreeSet()Default Constructor -
LongRBTreeSet
Constructor that allows to define the sorter- Parameter:
comp- the function that decides how the tree is sorted, can be null
-
LongRBTreeSet
public LongRBTreeSet(long[] array) Helper constructor that allow to create a set from an array- Parameter:
array- the elements that should be used
-
LongRBTreeSet
public LongRBTreeSet(long[] 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
-
LongRBTreeSet
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
-
LongRBTreeSet
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
-
LongRBTreeSet
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
-
LongRBTreeSet
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
-
LongRBTreeSet
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
-
LongRBTreeSet
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
-
LongRBTreeSet
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
-
LongRBTreeSet
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
-
LongRBTreeSet
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
-
LongRBTreeSet
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
-
LongRBTreeSet
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(long value) Beschreibung aus Schnittstelle kopiert:LongNavigableSetA Helper method to set the max value for SubSets. (Default: long.MIN_VALUE)- Angegeben von:
setDefaultMaxValuein SchnittstelleLongNavigableSet- Parameter:
value- the new max value
-
getDefaultMaxValue
public long getDefaultMaxValue()Beschreibung aus Schnittstelle kopiert:LongNavigableSetA Helper method to get the max value for SubSets.- Angegeben von:
getDefaultMaxValuein SchnittstelleLongNavigableSet- Gibt zurück:
- the default max value.
-
setDefaultMinValue
public void setDefaultMinValue(long value) Beschreibung aus Schnittstelle kopiert:LongNavigableSetA Helper method to set the min value for SubSets. (Default: long.MAX_VALUE)- Angegeben von:
setDefaultMinValuein SchnittstelleLongNavigableSet- Parameter:
value- the new min value
-
getDefaultMinValue
public long getDefaultMinValue()Beschreibung aus Schnittstelle kopiert:LongNavigableSetA Helper method to get the min value for SubSets.- Angegeben von:
getDefaultMinValuein SchnittstelleLongNavigableSet- Gibt zurück:
- the default min value.
-
add
public boolean add(long o) Beschreibung aus Schnittstelle kopiert:LongCollectionA Type-Specific add function to reduce (un)boxing- Angegeben von:
addin SchnittstelleLongCollection- Parameter:
o- the element that should be added- Gibt zurück:
- true if the element was added to the collection
-
lower
public long lower(long e) Beschreibung aus Schnittstelle kopiert:LongNavigableSetA Type Specific lower method to reduce boxing/unboxing.- Angegeben von:
lowerin SchnittstelleLongNavigableSet- Parameter:
e- that should be compared with.- Gibt zurück:
- the greatest lower key that can be found
-
floor
public long floor(long e) Beschreibung aus Schnittstelle kopiert:LongNavigableSetA Type Specific floor method to reduce boxing/unboxing.- Angegeben von:
floorin SchnittstelleLongNavigableSet- Parameter:
e- that should be compared with.- Gibt zurück:
- the greatest lower or equal key that can be found
-
higher
public long higher(long e) Beschreibung aus Schnittstelle kopiert:LongNavigableSetA Type Specific higher method to reduce boxing/unboxing.- Angegeben von:
higherin SchnittstelleLongNavigableSet- Parameter:
e- that should be compared with.- Gibt zurück:
- the lowest higher key that can be found
-
ceiling
public long ceiling(long e) Beschreibung aus Schnittstelle kopiert:LongNavigableSetA Type Specific ceiling method to reduce boxing/unboxing.- Angegeben von:
ceilingin SchnittstelleLongNavigableSet- Parameter:
e- that should be compared with.- Gibt zurück:
- the lowest higher or equal key that can be found
-
lower
- Angegeben von:
lowerin SchnittstelleLongNavigableSet- Angegeben von:
lowerin SchnittstelleNavigableSet<Long>
-
floor
- Angegeben von:
floorin SchnittstelleLongNavigableSet- Angegeben von:
floorin SchnittstelleNavigableSet<Long>
-
higher
- Angegeben von:
higherin SchnittstelleLongNavigableSet- Angegeben von:
higherin SchnittstelleNavigableSet<Long>
-
ceiling
- Angegeben von:
ceilingin SchnittstelleLongNavigableSet- Angegeben von:
ceilingin SchnittstelleNavigableSet<Long>
-
forEach
Beschreibung aus Schnittstelle kopiert:LongIterableA Type Specific foreach function that reduces (un)boxing- Angegeben von:
forEachin SchnittstelleLongIterable- Parameter:
action- The action to be performed for each element- Siehe auch:
-
forEachIndexed
Beschreibung aus Schnittstelle kopiert:LongIterableA Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.- Angegeben von:
forEachIndexedin SchnittstelleLongIterable- Parameter:
action- The action to be performed for each element
-
forEach
Beschreibung aus Schnittstelle kopiert:LongIterableHelper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.- Angegeben von:
forEachin SchnittstelleLongIterable- 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:LongIterableHelper function to reduce stream usage that allows to filter for any matches.- Angegeben von:
matchesAnyin SchnittstelleLongIterable- Parameter:
filter- that should be applied- Gibt zurück:
- true if any matches were found
-
matchesNone
Beschreibung aus Schnittstelle kopiert:LongIterableHelper function to reduce stream usage that allows to filter for no matches.- Angegeben von:
matchesNonein SchnittstelleLongIterable- Parameter:
filter- that should be applied- Gibt zurück:
- true if no matches were found
-
matchesAll
Beschreibung aus Schnittstelle kopiert:LongIterableHelper function to reduce stream usage that allows to filter for all matches.- Angegeben von:
matchesAllin SchnittstelleLongIterable- Parameter:
filter- that should be applied- Gibt zurück:
- true if all matches.
-
reduce
Beschreibung aus Schnittstelle kopiert:LongIterablePerforms a reduction on the elements of this Iterable- Angegeben von:
reducein SchnittstelleLongIterable- 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:LongIterablePerforms a reduction on the elements of this Iterable- Angegeben von:
reducein SchnittstelleLongIterable- 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:LongIterableHelper function to reduce stream usage that allows to filter for the first match.- Angegeben von:
findFirstin SchnittstelleLongIterable- Parameter:
filter- that should be applied- Gibt zurück:
- the found value or the null equivalent variant.
-
count
Beschreibung aus Schnittstelle kopiert:LongIterableHelper function to reduce stream usage that allows to count the valid elements.- Angegeben von:
countin SchnittstelleLongIterable- Parameter:
filter- that should be applied- Gibt zurück:
- the amount of Valid Elements
-
contains
public boolean contains(long e) Beschreibung aus Klasse kopiert:AbstractLongCollectionA Type-Specific implementation of contains. This implementation iterates over the elements and returns true if the value match.- Angegeben von:
containsin SchnittstelleLongCollection- Setzt außer Kraft:
containsin KlasseAbstractLongCollection- Parameter:
e- the element that should be searched for.- Gibt zurück:
- true if the value was found.
-
contains
Beschreibung aus Klasse kopiert:AbstractLongCollectionThis default implementation delegates to the corresponding type-specific function.
This default implementation delegates to the corresponding type-specific function.
- Angegeben von:
containsin SchnittstelleCollection<Long>- Angegeben von:
containsin SchnittstelleLongCollection- Angegeben von:
containsin SchnittstelleLongSet- Angegeben von:
containsin SchnittstelleSet<Long>- Setzt außer Kraft:
containsin KlasseAbstractLongCollection
-
firstLong
public long firstLong()Beschreibung aus Schnittstelle kopiert:LongSortedSetA method to get the first element in the set- Angegeben von:
firstLongin SchnittstelleLongSortedSet- Gibt zurück:
- first element in the set
-
lastLong
public long lastLong()Beschreibung aus Schnittstelle kopiert:LongSortedSetA method to get the last element in the set- Angegeben von:
lastLongin SchnittstelleLongSortedSet- Gibt zurück:
- last element in the set
-
remove
public boolean remove(long o) Beschreibung aus Schnittstelle kopiert:LongSetA Type Specific remove function to reduce boxing/unboxing -
remove
Beschreibung aus Klasse kopiert:AbstractLongCollectionThis default implementation delegates to the corresponding type-specific function.
This default implementation delegates to the corresponding type-specific function.
- Angegeben von:
removein SchnittstelleCollection<Long>- Angegeben von:
removein SchnittstelleLongCollection- Angegeben von:
removein SchnittstelleLongSet- Angegeben von:
removein SchnittstelleSet<Long>- Setzt außer Kraft:
removein KlasseAbstractLongCollection
-
pollFirstLong
public long pollFirstLong()Beschreibung aus Schnittstelle kopiert:LongSortedSetA method to get and remove the first element in the set- Angegeben von:
pollFirstLongin SchnittstelleLongSortedSet- Gibt zurück:
- first element in the set
-
pollLastLong
public long pollLastLong()Beschreibung aus Schnittstelle kopiert:LongSortedSetA method to get and remove the last element in the set- Angegeben von:
pollLastLongin SchnittstelleLongSortedSet- Gibt zurück:
- last element in the set
-
size
public int size()- Angegeben von:
sizein SchnittstelleCollection<Long>- Angegeben von:
sizein SchnittstelleISizeProvider- Angegeben von:
sizein SchnittstelleSet<Long>- Angegeben von:
sizein KlasseAbstractCollection<Long>- Gibt zurück:
- the size of the implementing Collection
-
clear
public void clear()- Angegeben von:
clearin SchnittstelleCollection<Long>- Angegeben von:
clearin SchnittstelleSet<Long>- Setzt außer Kraft:
clearin KlasseAbstractCollection<Long>
-
toLongArray
public long[] toLongArray(long[] a) Beschreibung aus Klasse kopiert:AbstractLongCollectionA Type-Specific implementation of toArray. This implementation iterates over all elements and unwraps them into primitive type.- Angegeben von:
toLongArrayin SchnittstelleLongCollection- Setzt außer Kraft:
toLongArrayin KlasseAbstractLongCollection- 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<Long>- Angegeben von:
toArrayin SchnittstelleSet<Long>- Setzt außer Kraft:
toArrayin KlasseAbstractCollection<Long>
-
toArray
Veraltet.- Angegeben von:
toArrayin SchnittstelleCollection<Long>- Angegeben von:
toArrayin SchnittstelleSet<Long>- Setzt außer Kraft:
toArrayin KlasseAbstractCollection<Long>
-
copy
Beschreibung aus Schnittstelle kopiert:LongCollectionA 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 SchnittstelleLongCollection- Angegeben von:
copyin SchnittstelleLongNavigableSet- Angegeben von:
copyin SchnittstelleLongSet- Angegeben von:
copyin SchnittstelleLongSortedSet- Setzt außer Kraft:
copyin KlasseAbstractLongSet- Gibt zurück:
- a Shallow Copy of the collection
-
comparator
Beschreibung aus Schnittstelle kopiert:LongSortedSetA Type Specific Comparator method- Angegeben von:
comparatorin SchnittstelleLongSortedSet- Angegeben von:
comparatorin SchnittstelleSortedSet<Long>- Gibt zurück:
- the type specific comparator
-
iterator
Beschreibung aus Schnittstelle kopiert:LongCollectionReturns a Type-Specific Iterator to reduce (un)boxing- Angegeben von:
iteratorin SchnittstelleCollection<Long>- Angegeben von:
iteratorin SchnittstelleIterable<Long>- Angegeben von:
iteratorin SchnittstelleLongCollection- Angegeben von:
iteratorin SchnittstelleLongIterable- Angegeben von:
iteratorin SchnittstelleLongNavigableSet- Angegeben von:
iteratorin SchnittstelleLongSet- Angegeben von:
iteratorin SchnittstelleLongSortedSet- Angegeben von:
iteratorin SchnittstelleNavigableSet<Long>- Angegeben von:
iteratorin SchnittstelleSet<Long>- Angegeben von:
iteratorin KlasseAbstractLongSet- Gibt zurück:
- a iterator of the collection
- Siehe auch:
-
iterator
Beschreibung aus Schnittstelle kopiert:LongSortedSetA type Specific Iterator starting from a given key- Angegeben von:
iteratorin SchnittstelleLongSortedSet- Parameter:
fromElement- the element the iterator should start from- Gibt zurück:
- a iterator starting from the given element
-
descendingIterator
- Angegeben von:
descendingIteratorin SchnittstelleLongNavigableSet- Angegeben von:
descendingIteratorin SchnittstelleNavigableSet<Long>- Gibt zurück:
- a Type Specific desendingIterator
-
subSet
public LongNavigableSet subSet(long fromElement, boolean fromInclusive, long toElement, boolean toInclusive) Beschreibung aus Schnittstelle kopiert:LongNavigableSetA Type Specific SubSet method to reduce boxing/unboxing- Angegeben von:
subSetin SchnittstelleLongNavigableSet- 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:LongNavigableSetA Type Specific HeadSet method to reduce boxing/unboxing- Angegeben von:
headSetin SchnittstelleLongNavigableSet- 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:LongNavigableSetA Type Specific TailSet method to reduce boxing/unboxing- Angegeben von:
tailSetin SchnittstelleLongNavigableSet- 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 SchnittstelleLongNavigableSet- Angegeben von:
descendingSetin SchnittstelleNavigableSet<Long>- Gibt zurück:
- a Type Specific desendingSet
-