java.lang.Object
java.util.AbstractCollection<Integer>
speiger.src.collections.ints.collections.AbstractIntCollection
speiger.src.collections.ints.sets.AbstractIntSet
speiger.src.collections.ints.sets.IntRBTreeSet
- Alle implementierten Schnittstellen:
Iterable<Integer>,Collection<Integer>,NavigableSet<Integer>,Set<Integer>,SortedSet<Integer>,IntCollection,IntIterable,IntNavigableSet,IntSet,IntSortedSet,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 ConstructorIntRBTreeSet(int[] array) Helper constructor that allow to create a set from an arrayIntRBTreeSet(int[] array, int offset, int length) Helper constructor that allow to create a set from an arrayIntRBTreeSet(int[] array, int offset, int length, IntComparator comp) Helper constructor that allow to create a set from an arrayIntRBTreeSet(int[] array, IntComparator comp) Helper constructor that allow to create a set from an arrayIntRBTreeSet(Collection<? extends Integer> collection) Veraltet.IntRBTreeSet(Collection<? extends Integer> collection, IntComparator comp) Veraltet.IntRBTreeSet(Iterator<Integer> iterator) A Helper constructor that allows to create a set from a iterator of an unknown sizeIntRBTreeSet(Iterator<Integer> iterator, IntComparator comp) A Helper constructor that allows to create a set from a iterator of an unknown sizeIntRBTreeSet(IntCollection collection) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.IntRBTreeSet(IntCollection collection, IntComparator comp) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.IntRBTreeSet(IntIterator iterator) A Helper constructor that allows to create a set from a iterator of an unknown sizeIntRBTreeSet(IntIterator iterator, IntComparator comp) A Helper constructor that allows to create a set from a iterator of an unknown sizeIntRBTreeSet(IntComparator comp) Constructor that allows to define the sorterIntRBTreeSet(IntSortedSet sortedSet) A Helper constructor that allows to create a Set with exactly the same values as the provided SortedSet. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanadd(int o) A Type-Specific add function to reduce (un)boxingintceiling(int e) A Type Specific ceiling method to reduce boxing/unboxing.voidclear()A Type Specific Comparator methodbooleancontains(int e) A Type-Specific implementation of contains.booleancopy()A Function that does a shallow clone of the Collection itself.intcount(IntPredicate filter) Helper function to reduce stream usage that allows to count the valid elements.intfindFirst(IntPredicate filter) Helper function to reduce stream usage that allows to filter for the first match.intfirstInt()A method to get the first element in the setintfloor(int e) A Type Specific floor method to reduce boxing/unboxing.<E> voidforEach(E input, ObjectIntConsumer<E> action) Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.voidforEach(IntConsumer action) A Type Specific foreach function that reduces (un)boxingvoidforEachIndexed(IntIntConsumer action) A Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.intA Helper method to get the max value for SubSets.intA Helper method to get the min value for SubSets.headSet(int toElement, boolean inclusive) A Type Specific HeadSet method to reduce boxing/unboxinginthigher(int e) A Type Specific higher method to reduce boxing/unboxing.iterator()Returns a Type-Specific Iterator to reduce (un)boxingiterator(int fromElement) A type Specific Iterator starting from a given keyintlastInt()A method to get the last element in the setintlower(int e) A Type Specific lower method to reduce boxing/unboxing.booleanmatchesAll(IntPredicate filter) Helper function to reduce stream usage that allows to filter for all matches.booleanmatchesAny(IntPredicate filter) Helper function to reduce stream usage that allows to filter for any matches.booleanmatchesNone(IntPredicate filter) Helper function to reduce stream usage that allows to filter for no matches.intA method to get and remove the first element in the setintA method to get and remove the last element in the setintreduce(int identity, IntIntUnaryOperator operator) Performs a reduction on the elements of this Iterableintreduce(IntIntUnaryOperator operator) Performs a reduction on the elements of this Iterablebooleanremove(int o) A Type Specific remove function to reduce boxing/unboxingbooleanvoidsetDefaultMaxValue(int value) A Helper method to set the max value for SubSets.voidsetDefaultMinValue(int value) A Helper method to set the min value for SubSets.intsize()subSet(int fromElement, boolean fromInclusive, int toElement, boolean toInclusive) A Type Specific SubSet method to reduce boxing/unboxingtailSet(int fromElement, boolean inclusive) A Type Specific TailSet method to reduce boxing/unboxingObject[]toArray()Veraltet.<E> E[]toArray(E[] a) Veraltet.int[]toIntArray(int[] a) A Type-Specific implementation of toArray.Von Klasse geerbte Methoden speiger.src.collections.ints.sets.AbstractIntSet
equals, hashCodeVon Klasse geerbte Methoden speiger.src.collections.ints.collections.AbstractIntCollection
add, addAll, addAll, containsAll, containsAll, containsAny, containsAny, remInt, removeAll, removeAll, retainAll, retainAll, toIntArrayVon 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.ints.collections.IntCollection
addAll, addAll, addAll, addAll, containsAll, containsAny, containsAny, parallelPrimitiveStream, pour, primitiveStream, remIf, removeAll, removeAll, removeIf, retainAll, retainAll, spliterator, toIntArrayVon Schnittstelle geerbte Methoden speiger.src.collections.ints.collections.IntIterable
arrayflatMap, asAsync, distinct, filter, flatMap, forEach, limit, map, peek, pourAsList, pourAsSet, repeat, sortedVon Schnittstelle geerbte Methoden speiger.src.collections.ints.sets.IntNavigableSet
first, headSet, headSet, headSet, last, pollFirst, pollLast, spliterator, subSet, subSet, subSet, synchronize, synchronize, tailSet, tailSet, tailSet, unmodifiable
-
Konstruktordetails
-
IntRBTreeSet
public IntRBTreeSet()Default Constructor -
IntRBTreeSet
Constructor that allows to define the sorter- Parameter:
comp- the function that decides how the tree is sorted, can be null
-
IntRBTreeSet
public IntRBTreeSet(int[] array) Helper constructor that allow to create a set from an array- Parameter:
array- the elements that should be used
-
IntRBTreeSet
public IntRBTreeSet(int[] 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
-
IntRBTreeSet
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
-
IntRBTreeSet
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
-
IntRBTreeSet
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
-
IntRBTreeSet
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
-
IntRBTreeSet
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
-
IntRBTreeSet
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
-
IntRBTreeSet
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
-
IntRBTreeSet
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
-
IntRBTreeSet
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
-
IntRBTreeSet
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
-
IntRBTreeSet
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(int value) Beschreibung aus Schnittstelle kopiert:IntNavigableSetA Helper method to set the max value for SubSets. (Default: int.MIN_VALUE)- Angegeben von:
setDefaultMaxValuein SchnittstelleIntNavigableSet- Parameter:
value- the new max value
-
getDefaultMaxValue
public int getDefaultMaxValue()Beschreibung aus Schnittstelle kopiert:IntNavigableSetA Helper method to get the max value for SubSets.- Angegeben von:
getDefaultMaxValuein SchnittstelleIntNavigableSet- Gibt zurück:
- the default max value.
-
setDefaultMinValue
public void setDefaultMinValue(int value) Beschreibung aus Schnittstelle kopiert:IntNavigableSetA Helper method to set the min value for SubSets. (Default: int.MAX_VALUE)- Angegeben von:
setDefaultMinValuein SchnittstelleIntNavigableSet- Parameter:
value- the new min value
-
getDefaultMinValue
public int getDefaultMinValue()Beschreibung aus Schnittstelle kopiert:IntNavigableSetA Helper method to get the min value for SubSets.- Angegeben von:
getDefaultMinValuein SchnittstelleIntNavigableSet- Gibt zurück:
- the default min value.
-
add
public boolean add(int o) Beschreibung aus Schnittstelle kopiert:IntCollectionA Type-Specific add function to reduce (un)boxing- Angegeben von:
addin SchnittstelleIntCollection- Parameter:
o- the element that should be added- Gibt zurück:
- true if the element was added to the collection
-
lower
public int lower(int e) Beschreibung aus Schnittstelle kopiert:IntNavigableSetA Type Specific lower method to reduce boxing/unboxing.- Angegeben von:
lowerin SchnittstelleIntNavigableSet- Parameter:
e- that should be compared with.- Gibt zurück:
- the greatest lower key that can be found
-
floor
public int floor(int e) Beschreibung aus Schnittstelle kopiert:IntNavigableSetA Type Specific floor method to reduce boxing/unboxing.- Angegeben von:
floorin SchnittstelleIntNavigableSet- Parameter:
e- that should be compared with.- Gibt zurück:
- the greatest lower or equal key that can be found
-
higher
public int higher(int e) Beschreibung aus Schnittstelle kopiert:IntNavigableSetA Type Specific higher method to reduce boxing/unboxing.- Angegeben von:
higherin SchnittstelleIntNavigableSet- Parameter:
e- that should be compared with.- Gibt zurück:
- the lowest higher key that can be found
-
ceiling
public int ceiling(int e) Beschreibung aus Schnittstelle kopiert:IntNavigableSetA Type Specific ceiling method to reduce boxing/unboxing.- Angegeben von:
ceilingin SchnittstelleIntNavigableSet- Parameter:
e- that should be compared with.- Gibt zurück:
- the lowest higher or equal key that can be found
-
lower
- Angegeben von:
lowerin SchnittstelleIntNavigableSet- Angegeben von:
lowerin SchnittstelleNavigableSet<Integer>
-
floor
- Angegeben von:
floorin SchnittstelleIntNavigableSet- Angegeben von:
floorin SchnittstelleNavigableSet<Integer>
-
higher
- Angegeben von:
higherin SchnittstelleIntNavigableSet- Angegeben von:
higherin SchnittstelleNavigableSet<Integer>
-
ceiling
- Angegeben von:
ceilingin SchnittstelleIntNavigableSet- Angegeben von:
ceilingin SchnittstelleNavigableSet<Integer>
-
forEach
Beschreibung aus Schnittstelle kopiert:IntIterableA Type Specific foreach function that reduces (un)boxing- Angegeben von:
forEachin SchnittstelleIntIterable- Parameter:
action- The action to be performed for each element- Siehe auch:
-
forEachIndexed
Beschreibung aus Schnittstelle kopiert:IntIterableA Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.- Angegeben von:
forEachIndexedin SchnittstelleIntIterable- Parameter:
action- The action to be performed for each element
-
forEach
Beschreibung aus Schnittstelle kopiert:IntIterableHelper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.- Angegeben von:
forEachin SchnittstelleIntIterable- 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:IntIterableHelper function to reduce stream usage that allows to filter for any matches.- Angegeben von:
matchesAnyin SchnittstelleIntIterable- Parameter:
filter- that should be applied- Gibt zurück:
- true if any matches were found
-
matchesNone
Beschreibung aus Schnittstelle kopiert:IntIterableHelper function to reduce stream usage that allows to filter for no matches.- Angegeben von:
matchesNonein SchnittstelleIntIterable- Parameter:
filter- that should be applied- Gibt zurück:
- true if no matches were found
-
matchesAll
Beschreibung aus Schnittstelle kopiert:IntIterableHelper function to reduce stream usage that allows to filter for all matches.- Angegeben von:
matchesAllin SchnittstelleIntIterable- Parameter:
filter- that should be applied- Gibt zurück:
- true if all matches.
-
reduce
Beschreibung aus Schnittstelle kopiert:IntIterablePerforms a reduction on the elements of this Iterable- Angegeben von:
reducein SchnittstelleIntIterable- 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:IntIterablePerforms a reduction on the elements of this Iterable- Angegeben von:
reducein SchnittstelleIntIterable- 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:IntIterableHelper function to reduce stream usage that allows to filter for the first match.- Angegeben von:
findFirstin SchnittstelleIntIterable- Parameter:
filter- that should be applied- Gibt zurück:
- the found value or the null equivalent variant.
-
count
Beschreibung aus Schnittstelle kopiert:IntIterableHelper function to reduce stream usage that allows to count the valid elements.- Angegeben von:
countin SchnittstelleIntIterable- Parameter:
filter- that should be applied- Gibt zurück:
- the amount of Valid Elements
-
contains
public boolean contains(int e) Beschreibung aus Klasse kopiert:AbstractIntCollectionA Type-Specific implementation of contains. This implementation iterates over the elements and returns true if the value match.- Angegeben von:
containsin SchnittstelleIntCollection- Setzt außer Kraft:
containsin KlasseAbstractIntCollection- Parameter:
e- the element that should be searched for.- Gibt zurück:
- true if the value was found.
-
contains
Beschreibung aus Klasse kopiert:AbstractIntCollectionThis default implementation delegates to the corresponding type-specific function.
This default implementation delegates to the corresponding type-specific function.
- Angegeben von:
containsin SchnittstelleCollection<Integer>- Angegeben von:
containsin SchnittstelleIntCollection- Angegeben von:
containsin SchnittstelleIntSet- Angegeben von:
containsin SchnittstelleSet<Integer>- Setzt außer Kraft:
containsin KlasseAbstractIntCollection
-
firstInt
public int firstInt()Beschreibung aus Schnittstelle kopiert:IntSortedSetA method to get the first element in the set- Angegeben von:
firstIntin SchnittstelleIntSortedSet- Gibt zurück:
- first element in the set
-
lastInt
public int lastInt()Beschreibung aus Schnittstelle kopiert:IntSortedSetA method to get the last element in the set- Angegeben von:
lastIntin SchnittstelleIntSortedSet- Gibt zurück:
- last element in the set
-
remove
public boolean remove(int o) Beschreibung aus Schnittstelle kopiert:IntSetA Type Specific remove function to reduce boxing/unboxing -
remove
Beschreibung aus Klasse kopiert:AbstractIntCollectionThis default implementation delegates to the corresponding type-specific function.
This default implementation delegates to the corresponding type-specific function.
- Angegeben von:
removein SchnittstelleCollection<Integer>- Angegeben von:
removein SchnittstelleIntCollection- Angegeben von:
removein SchnittstelleIntSet- Angegeben von:
removein SchnittstelleSet<Integer>- Setzt außer Kraft:
removein KlasseAbstractIntCollection
-
pollFirstInt
public int pollFirstInt()Beschreibung aus Schnittstelle kopiert:IntSortedSetA method to get and remove the first element in the set- Angegeben von:
pollFirstIntin SchnittstelleIntSortedSet- Gibt zurück:
- first element in the set
-
pollLastInt
public int pollLastInt()Beschreibung aus Schnittstelle kopiert:IntSortedSetA method to get and remove the last element in the set- Angegeben von:
pollLastIntin SchnittstelleIntSortedSet- Gibt zurück:
- last element in the set
-
size
public int size()- Angegeben von:
sizein SchnittstelleCollection<Integer>- Angegeben von:
sizein SchnittstelleISizeProvider- Angegeben von:
sizein SchnittstelleSet<Integer>- Angegeben von:
sizein KlasseAbstractCollection<Integer>- Gibt zurück:
- the size of the implementing Collection
-
clear
public void clear()- Angegeben von:
clearin SchnittstelleCollection<Integer>- Angegeben von:
clearin SchnittstelleSet<Integer>- Setzt außer Kraft:
clearin KlasseAbstractCollection<Integer>
-
toIntArray
public int[] toIntArray(int[] a) Beschreibung aus Klasse kopiert:AbstractIntCollectionA Type-Specific implementation of toArray. This implementation iterates over all elements and unwraps them into primitive type.- Angegeben von:
toIntArrayin SchnittstelleIntCollection- Setzt außer Kraft:
toIntArrayin KlasseAbstractIntCollection- 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<Integer>- Angegeben von:
toArrayin SchnittstelleSet<Integer>- Setzt außer Kraft:
toArrayin KlasseAbstractCollection<Integer>
-
toArray
Veraltet.- Angegeben von:
toArrayin SchnittstelleCollection<Integer>- Angegeben von:
toArrayin SchnittstelleSet<Integer>- Setzt außer Kraft:
toArrayin KlasseAbstractCollection<Integer>
-
copy
Beschreibung aus Schnittstelle kopiert:IntCollectionA 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 SchnittstelleIntCollection- Angegeben von:
copyin SchnittstelleIntNavigableSet- Angegeben von:
copyin SchnittstelleIntSet- Angegeben von:
copyin SchnittstelleIntSortedSet- Setzt außer Kraft:
copyin KlasseAbstractIntSet- Gibt zurück:
- a Shallow Copy of the collection
-
comparator
Beschreibung aus Schnittstelle kopiert:IntSortedSetA Type Specific Comparator method- Angegeben von:
comparatorin SchnittstelleIntSortedSet- Angegeben von:
comparatorin SchnittstelleSortedSet<Integer>- Gibt zurück:
- the type specific comparator
-
iterator
Beschreibung aus Schnittstelle kopiert:IntCollectionReturns a Type-Specific Iterator to reduce (un)boxing- Angegeben von:
iteratorin SchnittstelleCollection<Integer>- Angegeben von:
iteratorin SchnittstelleIntCollection- Angegeben von:
iteratorin SchnittstelleIntIterable- Angegeben von:
iteratorin SchnittstelleIntNavigableSet- Angegeben von:
iteratorin SchnittstelleIntSet- Angegeben von:
iteratorin SchnittstelleIntSortedSet- Angegeben von:
iteratorin SchnittstelleIterable<Integer>- Angegeben von:
iteratorin SchnittstelleNavigableSet<Integer>- Angegeben von:
iteratorin SchnittstelleSet<Integer>- Angegeben von:
iteratorin KlasseAbstractIntSet- Gibt zurück:
- a iterator of the collection
- Siehe auch:
-
iterator
Beschreibung aus Schnittstelle kopiert:IntSortedSetA type Specific Iterator starting from a given key- Angegeben von:
iteratorin SchnittstelleIntSortedSet- Parameter:
fromElement- the element the iterator should start from- Gibt zurück:
- a iterator starting from the given element
-
descendingIterator
- Angegeben von:
descendingIteratorin SchnittstelleIntNavigableSet- Angegeben von:
descendingIteratorin SchnittstelleNavigableSet<Integer>- Gibt zurück:
- a Type Specific desendingIterator
-
subSet
public IntNavigableSet subSet(int fromElement, boolean fromInclusive, int toElement, boolean toInclusive) Beschreibung aus Schnittstelle kopiert:IntNavigableSetA Type Specific SubSet method to reduce boxing/unboxing- Angegeben von:
subSetin SchnittstelleIntNavigableSet- 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:IntNavigableSetA Type Specific HeadSet method to reduce boxing/unboxing- Angegeben von:
headSetin SchnittstelleIntNavigableSet- 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:IntNavigableSetA Type Specific TailSet method to reduce boxing/unboxing- Angegeben von:
tailSetin SchnittstelleIntNavigableSet- 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 SchnittstelleIntNavigableSet- Angegeben von:
descendingSetin SchnittstelleNavigableSet<Integer>- Gibt zurück:
- a Type Specific desendingSet
-