java.lang.Object
java.util.AbstractCollection<Long>
speiger.src.collections.longs.collections.AbstractLongCollection
speiger.src.collections.longs.sets.AbstractLongSet
speiger.src.collections.longs.sets.LongArraySet
- Alle implementierten Schnittstellen:
Iterable<Long>,Collection<Long>,Set<Long>,LongCollection,LongIterable,LongOrderedSet,LongSet,ISizeProvider
A Type Specific ArraySet implementation.
That is based around the idea of
List.indexOf(Object) for no duplication.
Unless a array constructor is used the ArraySet does not allow for duplication.
This implementation does not shrink the backing array-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen speiger.src.collections.utils.ISizeProvider
ISizeProvider.CollectionSize -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungDefault ConstructorLongArraySet(int capacity) Minimum Capacity ConstructorLongArraySet(long[] array) Constructur using initial ArrayLongArraySet(long[] array, int length) Constructur using initial ArrayLongArraySet(Collection<? extends Long> c) Veraltet.LongArraySet(Set<? extends Long> s) Veraltet.A Helper constructor that allows to create a Set with exactly the same values as the provided collection.A Helper constructor that fast copies the element out of a set into the ArraySet. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanadd(long o) A Type-Specific add function to reduce (un)boxingbooleanaddAndMoveToFirst(long o) A customized add method that allows you to insert into the first index.booleanaddAndMoveToLast(long o) A customized add method that allows you to insert into the last index.voidclear()booleancontains(long e) A Type-Specific implementation of contains.copy()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 set<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.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 setbooleanmatchesAll(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.booleanmoveToFirst(long o) A specific move method to move a given key to the first index.booleanmoveToLast(long o) A specific move method to move a given key to the last index.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 IterablebooleanremIf(LongPredicate filter) A Type-Specific removeIf function to reduce (un)boxing.booleanremove(long o) A Type Specific remove function to reduce boxing/unboxingbooleanremoveAll(Collection<?> c) Veraltet.booleanA Type-Specific implementation of removeAll.booleanA Type-Specific removeAll function that reduces (un)boxing.booleanretainAll(Collection<?> c) Veraltet.booleanA Type-Specific implementation of retainAll.booleanA Type-Specific retainAll function that reduces (un)boxing.intsize()Object[]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, contains, containsAll, containsAll, containsAny, containsAny, remLong, remove, toLongArrayVon Klasse geerbte Methoden java.util.AbstractCollection
isEmpty, 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, removeIf, 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.LongOrderedSet
spliterator, synchronize, synchronize, unmodifiable
-
Konstruktordetails
-
LongArraySet
public LongArraySet()Default Constructor -
LongArraySet
public LongArraySet(int capacity) Minimum Capacity Constructor- Parameter:
capacity- the minimum capacity of the internal array- Löst aus:
NegativeArraySizeException- if the capacity is negative
-
LongArraySet
public LongArraySet(long[] array) Constructur using initial Array- Parameter:
array- the array that should be used for set.
-
LongArraySet
public LongArraySet(long[] array, int length) Constructur using initial Array- Parameter:
array- the array that should be used for set.length- the amount of elements present within the array- Löst aus:
NegativeArraySizeException- if the length is negative
-
LongArraySet
Veraltet.A Helper constructor that allows to create a Set with exactly the same values as the provided collection.- Parameter:
c- the elements that should be added to the set.- Note:
- this slowly checks every element to remove duplicates
-
LongArraySet
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.- Parameter:
c- the elements that should be added to the set.- Note:
- this slowly checks every element to remove duplicates
-
LongArraySet
Veraltet.A Helper constructor that fast copies the element out of a set into the ArraySet. Since it is assumed that there is no duplication in the first place- Parameter:
s- the set the element should be taken from
-
LongArraySet
A Helper constructor that fast copies the element out of a set into the ArraySet. Since it is assumed that there is no duplication in the first place- Parameter:
s- the set the element should be taken from
-
-
Methodendetails
-
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
-
addAndMoveToFirst
public boolean addAndMoveToFirst(long o) Beschreibung aus Schnittstelle kopiert:LongOrderedSetA customized add method that allows you to insert into the first index.- Angegeben von:
addAndMoveToFirstin SchnittstelleLongOrderedSet- Parameter:
o- the element that should be inserted- Gibt zurück:
- true if it was added
- Siehe auch:
-
addAndMoveToLast
public boolean addAndMoveToLast(long o) Beschreibung aus Schnittstelle kopiert:LongOrderedSetA customized add method that allows you to insert into the last index.- Angegeben von:
addAndMoveToLastin SchnittstelleLongOrderedSet- Parameter:
o- the element that should be inserted- Gibt zurück:
- true if it was added
- Siehe auch:
-
moveToFirst
public boolean moveToFirst(long o) Beschreibung aus Schnittstelle kopiert:LongOrderedSetA specific move method to move a given key to the first index.- Angegeben von:
moveToFirstin SchnittstelleLongOrderedSet- Parameter:
o- that should be moved to the first index- Gibt zurück:
- true if the value was moved.
-
moveToLast
public boolean moveToLast(long o) Beschreibung aus Schnittstelle kopiert:LongOrderedSetA specific move method to move a given key to the last index.- Angegeben von:
moveToLastin SchnittstelleLongOrderedSet- Parameter:
o- that should be moved to the first last- Gibt zurück:
- true if the value was moved.
-
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.
-
firstLong
public long firstLong()Beschreibung aus Schnittstelle kopiert:LongOrderedSetA method to get the first element in the set- Angegeben von:
firstLongin SchnittstelleLongOrderedSet- Gibt zurück:
- first element in the set
-
lastLong
public long lastLong()Beschreibung aus Schnittstelle kopiert:LongOrderedSetA method to get the last element in the set- Angegeben von:
lastLongin SchnittstelleLongOrderedSet- Gibt zurück:
- last element in the set
-
removeAll
Beschreibung aus Klasse kopiert:AbstractLongCollectionA 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 SchnittstelleLongCollection- Setzt außer Kraft:
removeAllin KlasseAbstractLongCollection- Parameter:
c- the elements that should be deleted- Gibt zurück:
- true if the collection was modified.
- Siehe auch:
-
removeAll
Beschreibung aus Schnittstelle kopiert:LongCollectionA 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 SchnittstelleLongCollection- Setzt außer Kraft:
removeAllin KlasseAbstractLongCollection- 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 Klasse kopiert:AbstractLongCollectionA 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 SchnittstelleLongCollection- Setzt außer Kraft:
retainAllin KlasseAbstractLongCollection- Parameter:
c- the elements that should be kept- Gibt zurück:
- true if the collection was modified.
- Siehe auch:
-
retainAll
Beschreibung aus Schnittstelle kopiert:LongCollectionA 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 SchnittstelleLongCollection- Setzt außer Kraft:
retainAllin KlasseAbstractLongCollection- 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:
-
removeAll
Veraltet.- Angegeben von:
removeAllin SchnittstelleCollection<Long>- Angegeben von:
removeAllin SchnittstelleSet<Long>- Setzt außer Kraft:
removeAllin KlasseAbstractCollection<Long>
-
retainAll
Veraltet.- Angegeben von:
retainAllin SchnittstelleCollection<Long>- Angegeben von:
retainAllin SchnittstelleSet<Long>- Setzt außer Kraft:
retainAllin KlasseAbstractCollection<Long>
-
remove
public boolean remove(long o) Beschreibung aus Schnittstelle kopiert:LongSetA Type Specific remove function to reduce boxing/unboxing -
pollFirstLong
public long pollFirstLong()Beschreibung aus Schnittstelle kopiert:LongOrderedSetA method to get and remove the first element in the set- Angegeben von:
pollFirstLongin SchnittstelleLongOrderedSet- Gibt zurück:
- first element in the set
-
pollLastLong
public long pollLastLong()Beschreibung aus Schnittstelle kopiert:LongOrderedSetA method to get and remove the last element in the set- Angegeben von:
pollLastLongin SchnittstelleLongOrderedSet- Gibt zurück:
- last element in the set
-
remIf
Beschreibung aus Schnittstelle kopiert:LongCollectionA Type-Specific removeIf function to reduce (un)boxing.Removes elements that were selected by the filter
- Angegeben von:
remIfin SchnittstelleLongCollection- Parameter:
filter- Filters the elements that should be removed- Gibt zurück:
- true if the collection was modified
- Siehe auch:
-
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.
-
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.
-
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
-
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
-
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 SchnittstelleLongOrderedSet- Angegeben von:
iteratorin SchnittstelleLongSet- Angegeben von:
iteratorin SchnittstelleSet<Long>- Angegeben von:
iteratorin KlasseAbstractLongSet- Gibt zurück:
- a iterator of the collection
- Siehe auch:
-
iterator
Beschreibung aus Schnittstelle kopiert:LongOrderedSetA type Specific Iterator starting from a given key- Angegeben von:
iteratorin SchnittstelleLongOrderedSet- Parameter:
fromElement- the element the iterator should start from- Gibt zurück:
- a iterator starting from the given element
-
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 SchnittstelleLongOrderedSet- Angegeben von:
copyin SchnittstelleLongSet- Setzt außer Kraft:
copyin KlasseAbstractLongSet- Gibt zurück:
- a Shallow Copy of the collection
-
clear
public void clear()- Angegeben von:
clearin SchnittstelleCollection<Long>- Angegeben von:
clearin SchnittstelleSet<Long>- Setzt außer Kraft:
clearin KlasseAbstractCollection<Long>
-
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
-
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>
-