java.lang.Object
java.util.AbstractCollection<Short>
speiger.src.collections.shorts.collections.AbstractShortCollection
speiger.src.collections.shorts.sets.AbstractShortSet
speiger.src.collections.shorts.sets.ShortAVLTreeSet
- Alle implementierten Schnittstellen:
Iterable<Short>,Collection<Short>,NavigableSet<Short>,Set<Short>,SortedSet<Short>,ShortCollection,ShortIterable,ShortNavigableSet,ShortSet,ShortSortedSet,ISizeProvider
A Simple Type Specific AVL 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 ConstructorShortAVLTreeSet(short[] array) Helper constructor that allow to create a set from an arrayShortAVLTreeSet(short[] array, int offset, int length) Helper constructor that allow to create a set from an arrayShortAVLTreeSet(short[] array, int offset, int length, ShortComparator comp) Helper constructor that allow to create a set from an arrayShortAVLTreeSet(short[] array, ShortComparator comp) Helper constructor that allow to create a set from an arrayShortAVLTreeSet(Collection<? extends Short> collection) Veraltet.ShortAVLTreeSet(Collection<? extends Short> collection, ShortComparator comp) Veraltet.ShortAVLTreeSet(Iterator<Short> iterator) A Helper constructor that allows to create a set from a iterator of an unknown sizeShortAVLTreeSet(Iterator<Short> iterator, ShortComparator comp) A Helper constructor that allows to create a set from a iterator of an unknown sizeShortAVLTreeSet(ShortCollection collection) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.ShortAVLTreeSet(ShortCollection collection, ShortComparator comp) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.ShortAVLTreeSet(ShortIterator iterator) A Helper constructor that allows to create a set from a iterator of an unknown sizeShortAVLTreeSet(ShortIterator iterator, ShortComparator comp) A Helper constructor that allows to create a set from a iterator of an unknown sizeConstructor that allows to define the sorterShortAVLTreeSet(ShortSortedSet sortedSet) A Helper constructor that allows to create a Set with exactly the same values as the provided SortedSet. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanadd(short o) A Type-Specific add function to reduce (un)boxingshortceiling(short e) A Type Specific ceiling method to reduce boxing/unboxing.voidclear()A Type Specific Comparator methodbooleancontains(short e) A Type-Specific implementation of contains.booleancopy()A Function that does a shallow clone of the Collection itself.intcount(ShortPredicate filter) Helper function to reduce stream usage that allows to count the valid elements.shortfindFirst(ShortPredicate filter) Helper function to reduce stream usage that allows to filter for the first match.shortA method to get the first element in the setshortfloor(short e) A Type Specific floor method to reduce boxing/unboxing.<E> voidforEach(E input, ObjectShortConsumer<E> action) Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.voidforEach(ShortConsumer action) A Type Specific foreach function that reduces (un)boxingvoidforEachIndexed(IntShortConsumer action) A Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.shortA Helper method to get the max value for SubSets.shortA Helper method to get the min value for SubSets.headSet(short toElement, boolean inclusive) A Type Specific HeadSet method to reduce boxing/unboxingshorthigher(short e) A Type Specific higher method to reduce boxing/unboxing.iterator()Returns a Type-Specific Iterator to reduce (un)boxingiterator(short fromElement) A type Specific Iterator starting from a given keyshortA method to get the last element in the setshortlower(short e) A Type Specific lower method to reduce boxing/unboxing.booleanmatchesAll(ShortPredicate filter) Helper function to reduce stream usage that allows to filter for all matches.booleanmatchesAny(ShortPredicate filter) Helper function to reduce stream usage that allows to filter for any matches.booleanmatchesNone(ShortPredicate filter) Helper function to reduce stream usage that allows to filter for no matches.shortA method to get and remove the first element in the setshortA method to get and remove the last element in the setshortreduce(short identity, ShortShortUnaryOperator operator) Performs a reduction on the elements of this Iterableshortreduce(ShortShortUnaryOperator operator) Performs a reduction on the elements of this Iterablebooleanremove(short o) A Type Specific remove function to reduce boxing/unboxingbooleanvoidsetDefaultMaxValue(short value) A Helper method to set the max value for SubSets.voidsetDefaultMinValue(short value) A Helper method to set the min value for SubSets.intsize()subSet(short fromElement, boolean fromInclusive, short toElement, boolean toInclusive) A Type Specific SubSet method to reduce boxing/unboxingtailSet(short fromElement, boolean inclusive) A Type Specific TailSet method to reduce boxing/unboxingObject[]toArray()Veraltet.<E> E[]toArray(E[] a) Veraltet.short[]toShortArray(short[] a) A Type-Specific implementation of toArray.Von Klasse geerbte Methoden speiger.src.collections.shorts.sets.AbstractShortSet
equals, hashCodeVon Klasse geerbte Methoden speiger.src.collections.shorts.collections.AbstractShortCollection
add, addAll, addAll, containsAll, containsAll, containsAny, containsAny, removeAll, removeAll, remShort, retainAll, retainAll, toShortArrayVon Klasse geerbte Methoden java.util.AbstractCollection
isEmpty, removeAll, retainAll, toStringVon Schnittstelle geerbte Methoden java.util.Collection
parallelStream, stream, toArrayVon Schnittstelle geerbte Methoden java.util.Set
addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAllVon Schnittstelle geerbte Methoden speiger.src.collections.shorts.collections.ShortCollection
addAll, addAll, addAll, addAll, containsAll, containsAny, containsAny, parallelPrimitiveStream, pour, primitiveStream, remIf, removeAll, removeAll, removeIf, retainAll, retainAll, spliterator, toShortArrayVon Schnittstelle geerbte Methoden speiger.src.collections.shorts.collections.ShortIterable
arrayflatMap, asAsync, distinct, filter, flatMap, forEach, limit, map, peek, pourAsList, pourAsSet, repeat, sortedVon Schnittstelle geerbte Methoden speiger.src.collections.shorts.sets.ShortNavigableSet
first, headSet, headSet, headSet, last, pollFirst, pollLast, spliterator, subSet, subSet, subSet, synchronize, synchronize, tailSet, tailSet, tailSet, unmodifiable
-
Konstruktordetails
-
ShortAVLTreeSet
public ShortAVLTreeSet()Default Constructor -
ShortAVLTreeSet
Constructor that allows to define the sorter- Parameter:
comp- the function that decides how the tree is sorted, can be null
-
ShortAVLTreeSet
public ShortAVLTreeSet(short[] array) Helper constructor that allow to create a set from an array- Parameter:
array- the elements that should be used
-
ShortAVLTreeSet
public ShortAVLTreeSet(short[] 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
-
ShortAVLTreeSet
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
-
ShortAVLTreeSet
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
-
ShortAVLTreeSet
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
-
ShortAVLTreeSet
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
-
ShortAVLTreeSet
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
-
ShortAVLTreeSet
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
-
ShortAVLTreeSet
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
-
ShortAVLTreeSet
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
-
ShortAVLTreeSet
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
-
ShortAVLTreeSet
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
-
ShortAVLTreeSet
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(short value) Beschreibung aus Schnittstelle kopiert:ShortNavigableSetA Helper method to set the max value for SubSets. (Default: short.MIN_VALUE)- Angegeben von:
setDefaultMaxValuein SchnittstelleShortNavigableSet- Parameter:
value- the new max value
-
getDefaultMaxValue
public short getDefaultMaxValue()Beschreibung aus Schnittstelle kopiert:ShortNavigableSetA Helper method to get the max value for SubSets.- Angegeben von:
getDefaultMaxValuein SchnittstelleShortNavigableSet- Gibt zurück:
- the default max value.
-
setDefaultMinValue
public void setDefaultMinValue(short value) Beschreibung aus Schnittstelle kopiert:ShortNavigableSetA Helper method to set the min value for SubSets. (Default: short.MAX_VALUE)- Angegeben von:
setDefaultMinValuein SchnittstelleShortNavigableSet- Parameter:
value- the new min value
-
getDefaultMinValue
public short getDefaultMinValue()Beschreibung aus Schnittstelle kopiert:ShortNavigableSetA Helper method to get the min value for SubSets.- Angegeben von:
getDefaultMinValuein SchnittstelleShortNavigableSet- Gibt zurück:
- the default min value.
-
add
public boolean add(short o) Beschreibung aus Schnittstelle kopiert:ShortCollectionA Type-Specific add function to reduce (un)boxing- Angegeben von:
addin SchnittstelleShortCollection- Parameter:
o- the element that should be added- Gibt zurück:
- true if the element was added to the collection
-
lower
public short lower(short e) Beschreibung aus Schnittstelle kopiert:ShortNavigableSetA Type Specific lower method to reduce boxing/unboxing.- Angegeben von:
lowerin SchnittstelleShortNavigableSet- Parameter:
e- that should be compared with.- Gibt zurück:
- the greatest lower key that can be found
-
floor
public short floor(short e) Beschreibung aus Schnittstelle kopiert:ShortNavigableSetA Type Specific floor method to reduce boxing/unboxing.- Angegeben von:
floorin SchnittstelleShortNavigableSet- Parameter:
e- that should be compared with.- Gibt zurück:
- the greatest lower or equal key that can be found
-
higher
public short higher(short e) Beschreibung aus Schnittstelle kopiert:ShortNavigableSetA Type Specific higher method to reduce boxing/unboxing.- Angegeben von:
higherin SchnittstelleShortNavigableSet- Parameter:
e- that should be compared with.- Gibt zurück:
- the lowest higher key that can be found
-
ceiling
public short ceiling(short e) Beschreibung aus Schnittstelle kopiert:ShortNavigableSetA Type Specific ceiling method to reduce boxing/unboxing.- Angegeben von:
ceilingin SchnittstelleShortNavigableSet- Parameter:
e- that should be compared with.- Gibt zurück:
- the lowest higher or equal key that can be found
-
lower
- Angegeben von:
lowerin SchnittstelleNavigableSet<Short>- Angegeben von:
lowerin SchnittstelleShortNavigableSet
-
floor
- Angegeben von:
floorin SchnittstelleNavigableSet<Short>- Angegeben von:
floorin SchnittstelleShortNavigableSet
-
higher
- Angegeben von:
higherin SchnittstelleNavigableSet<Short>- Angegeben von:
higherin SchnittstelleShortNavigableSet
-
ceiling
- Angegeben von:
ceilingin SchnittstelleNavigableSet<Short>- Angegeben von:
ceilingin SchnittstelleShortNavigableSet
-
forEach
Beschreibung aus Schnittstelle kopiert:ShortIterableA Type Specific foreach function that reduces (un)boxing- Angegeben von:
forEachin SchnittstelleShortIterable- Parameter:
action- The action to be performed for each element- Siehe auch:
-
forEachIndexed
Beschreibung aus Schnittstelle kopiert:ShortIterableA Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.- Angegeben von:
forEachIndexedin SchnittstelleShortIterable- Parameter:
action- The action to be performed for each element
-
forEach
Beschreibung aus Schnittstelle kopiert:ShortIterableHelper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.- Angegeben von:
forEachin SchnittstelleShortIterable- 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:ShortIterableHelper function to reduce stream usage that allows to filter for any matches.- Angegeben von:
matchesAnyin SchnittstelleShortIterable- Parameter:
filter- that should be applied- Gibt zurück:
- true if any matches were found
-
matchesNone
Beschreibung aus Schnittstelle kopiert:ShortIterableHelper function to reduce stream usage that allows to filter for no matches.- Angegeben von:
matchesNonein SchnittstelleShortIterable- Parameter:
filter- that should be applied- Gibt zurück:
- true if no matches were found
-
matchesAll
Beschreibung aus Schnittstelle kopiert:ShortIterableHelper function to reduce stream usage that allows to filter for all matches.- Angegeben von:
matchesAllin SchnittstelleShortIterable- Parameter:
filter- that should be applied- Gibt zurück:
- true if all matches.
-
findFirst
Beschreibung aus Schnittstelle kopiert:ShortIterableHelper function to reduce stream usage that allows to filter for the first match.- Angegeben von:
findFirstin SchnittstelleShortIterable- Parameter:
filter- that should be applied- Gibt zurück:
- the found value or the null equivalent variant.
-
reduce
Beschreibung aus Schnittstelle kopiert:ShortIterablePerforms a reduction on the elements of this Iterable- Angegeben von:
reducein SchnittstelleShortIterable- 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:ShortIterablePerforms a reduction on the elements of this Iterable- Angegeben von:
reducein SchnittstelleShortIterable- 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:ShortIterableHelper function to reduce stream usage that allows to count the valid elements.- Angegeben von:
countin SchnittstelleShortIterable- Parameter:
filter- that should be applied- Gibt zurück:
- the amount of Valid Elements
-
contains
public boolean contains(short e) Beschreibung aus Klasse kopiert:AbstractShortCollectionA Type-Specific implementation of contains. This implementation iterates over the elements and returns true if the value match.- Angegeben von:
containsin SchnittstelleShortCollection- Setzt außer Kraft:
containsin KlasseAbstractShortCollection- Parameter:
e- the element that should be searched for.- Gibt zurück:
- true if the value was found.
-
contains
Beschreibung aus Klasse kopiert:AbstractShortCollectionThis default implementation delegates to the corresponding type-specific function.
This default implementation delegates to the corresponding type-specific function.
- Angegeben von:
containsin SchnittstelleCollection<Short>- Angegeben von:
containsin SchnittstelleSet<Short>- Angegeben von:
containsin SchnittstelleShortCollection- Angegeben von:
containsin SchnittstelleShortSet- Setzt außer Kraft:
containsin KlasseAbstractShortCollection
-
firstShort
public short firstShort()Beschreibung aus Schnittstelle kopiert:ShortSortedSetA method to get the first element in the set- Angegeben von:
firstShortin SchnittstelleShortSortedSet- Gibt zurück:
- first element in the set
-
lastShort
public short lastShort()Beschreibung aus Schnittstelle kopiert:ShortSortedSetA method to get the last element in the set- Angegeben von:
lastShortin SchnittstelleShortSortedSet- Gibt zurück:
- last element in the set
-
remove
public boolean remove(short o) Beschreibung aus Schnittstelle kopiert:ShortSetA Type Specific remove function to reduce boxing/unboxing -
remove
Beschreibung aus Klasse kopiert:AbstractShortCollectionThis default implementation delegates to the corresponding type-specific function.
This default implementation delegates to the corresponding type-specific function.
- Angegeben von:
removein SchnittstelleCollection<Short>- Angegeben von:
removein SchnittstelleSet<Short>- Angegeben von:
removein SchnittstelleShortCollection- Angegeben von:
removein SchnittstelleShortSet- Setzt außer Kraft:
removein KlasseAbstractShortCollection
-
pollFirstShort
public short pollFirstShort()Beschreibung aus Schnittstelle kopiert:ShortSortedSetA method to get and remove the first element in the set- Angegeben von:
pollFirstShortin SchnittstelleShortSortedSet- Gibt zurück:
- first element in the set
-
pollLastShort
public short pollLastShort()Beschreibung aus Schnittstelle kopiert:ShortSortedSetA method to get and remove the last element in the set- Angegeben von:
pollLastShortin SchnittstelleShortSortedSet- Gibt zurück:
- last element in the set
-
size
public int size()- Angegeben von:
sizein SchnittstelleCollection<Short>- Angegeben von:
sizein SchnittstelleISizeProvider- Angegeben von:
sizein SchnittstelleSet<Short>- Angegeben von:
sizein KlasseAbstractCollection<Short>- Gibt zurück:
- the size of the implementing Collection
-
clear
public void clear()- Angegeben von:
clearin SchnittstelleCollection<Short>- Angegeben von:
clearin SchnittstelleSet<Short>- Setzt außer Kraft:
clearin KlasseAbstractCollection<Short>
-
toShortArray
public short[] toShortArray(short[] a) Beschreibung aus Klasse kopiert:AbstractShortCollectionA Type-Specific implementation of toArray. This implementation iterates over all elements and unwraps them into primitive type.- Angegeben von:
toShortArrayin SchnittstelleShortCollection- Setzt außer Kraft:
toShortArrayin KlasseAbstractShortCollection- 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<Short>- Angegeben von:
toArrayin SchnittstelleSet<Short>- Setzt außer Kraft:
toArrayin KlasseAbstractCollection<Short>
-
toArray
Veraltet.- Angegeben von:
toArrayin SchnittstelleCollection<Short>- Angegeben von:
toArrayin SchnittstelleSet<Short>- Setzt außer Kraft:
toArrayin KlasseAbstractCollection<Short>
-
copy
Beschreibung aus Schnittstelle kopiert:ShortCollectionA 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 SchnittstelleShortCollection- Angegeben von:
copyin SchnittstelleShortNavigableSet- Angegeben von:
copyin SchnittstelleShortSet- Angegeben von:
copyin SchnittstelleShortSortedSet- Setzt außer Kraft:
copyin KlasseAbstractShortSet- Gibt zurück:
- a Shallow Copy of the collection
-
comparator
Beschreibung aus Schnittstelle kopiert:ShortSortedSetA Type Specific Comparator method- Angegeben von:
comparatorin SchnittstelleShortSortedSet- Angegeben von:
comparatorin SchnittstelleSortedSet<Short>- Gibt zurück:
- the type specific comparator
-
iterator
Beschreibung aus Schnittstelle kopiert:ShortCollectionReturns a Type-Specific Iterator to reduce (un)boxing- Angegeben von:
iteratorin SchnittstelleCollection<Short>- Angegeben von:
iteratorin SchnittstelleIterable<Short>- Angegeben von:
iteratorin SchnittstelleNavigableSet<Short>- Angegeben von:
iteratorin SchnittstelleSet<Short>- Angegeben von:
iteratorin SchnittstelleShortCollection- Angegeben von:
iteratorin SchnittstelleShortIterable- Angegeben von:
iteratorin SchnittstelleShortNavigableSet- Angegeben von:
iteratorin SchnittstelleShortSet- Angegeben von:
iteratorin SchnittstelleShortSortedSet- Angegeben von:
iteratorin KlasseAbstractShortSet- Gibt zurück:
- a iterator of the collection
- Siehe auch:
-
iterator
Beschreibung aus Schnittstelle kopiert:ShortSortedSetA type Specific Iterator starting from a given key- Angegeben von:
iteratorin SchnittstelleShortSortedSet- Parameter:
fromElement- the element the iterator should start from- Gibt zurück:
- a iterator starting from the given element
-
descendingIterator
- Angegeben von:
descendingIteratorin SchnittstelleNavigableSet<Short>- Angegeben von:
descendingIteratorin SchnittstelleShortNavigableSet- Gibt zurück:
- a Type Specific desendingIterator
-
subSet
public ShortNavigableSet subSet(short fromElement, boolean fromInclusive, short toElement, boolean toInclusive) Beschreibung aus Schnittstelle kopiert:ShortNavigableSetA Type Specific SubSet method to reduce boxing/unboxing- Angegeben von:
subSetin SchnittstelleShortNavigableSet- 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:ShortNavigableSetA Type Specific HeadSet method to reduce boxing/unboxing- Angegeben von:
headSetin SchnittstelleShortNavigableSet- 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:ShortNavigableSetA Type Specific TailSet method to reduce boxing/unboxing- Angegeben von:
tailSetin SchnittstelleShortNavigableSet- 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 SchnittstelleNavigableSet<Short>- Angegeben von:
descendingSetin SchnittstelleShortNavigableSet- Gibt zurück:
- a Type Specific desendingSet
-