Modul speiger.src.collections
Klasse ObjectLinkedOpenHashSet<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.ObjectOpenHashSet<T>
speiger.src.collections.objects.sets.ObjectLinkedOpenHashSet<T>
- Typparameter:
T- the keyType of elements maintained by this Collection
- Alle implementierten Schnittstellen:
Iterable<T>,Collection<T>,Set<T>,ObjectCollection<T>,ObjectIterable<T>,ObjectOrderedSet<T>,ObjectSet<T>,ISizeProvider,ITrimmable
A Type Specific LinkedHashMap implementation that uses specific arrays to create links between nodes to remove the wrapping of elements
to greatly reduce memory usage. In Addition adding some helper methods to move around elements.
This implementation of SortedSet does not support SubSet of any kind. It implements the interface due to sortability and first/last access
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen speiger.src.collections.utils.ISizeProvider
ISizeProvider.CollectionSize -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungDefault ConstructorObjectLinkedOpenHashSet(int minCapacity) Constructor that defines the minimum capacityObjectLinkedOpenHashSet(int minCapacity, float loadFactor) Constructor that defines the minimum capacity and load factorObjectLinkedOpenHashSet(Collection<? extends T> collection) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.ObjectLinkedOpenHashSet(Collection<? extends T> collection, float loadFactor) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.ObjectLinkedOpenHashSet(Iterator<T> iterator) A Helper constructor that allows to create a set from a iterator of an unknown sizeObjectLinkedOpenHashSet(Iterator<T> iterator, float loadFactor) A Helper constructor that allows to create a set from a iterator of an unknown sizeObjectLinkedOpenHashSet(ObjectCollection<T> collection) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.ObjectLinkedOpenHashSet(ObjectCollection<T> collection, float loadFactor) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.ObjectLinkedOpenHashSet(T[] array) Helper constructor that allow to create a set from unboxed valuesObjectLinkedOpenHashSet(T[] array, float loadFactor) Helper constructor that allow to create a set from unboxed valuesObjectLinkedOpenHashSet(T[] array, int offset, int length) Helper constructor that allow to create a set from unboxed valuesObjectLinkedOpenHashSet(T[] array, int offset, int length, float loadFactor) Helper constructor that allow to create a set from unboxed values -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanA customized add method that allows you to insert into the first index.booleanA customized add method that allows you to insert into the last index.voidclear()voidclearAndTrim(int size) Trims the collection down to the requested size and clears all elements while doing socopy()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()A method to get the first element in the set<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.iterator()Returns a Type-Specific Iterator to reduce (un)boxingA type Specific Iterator starting from a given keylast()A method to get the last element in the setbooleanmatchesAll(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.booleanmoveToFirst(T o) A specific move method to move a given key to the first index.booleanmoveToLast(T o) A specific move method to move a given key to the last index.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 IterableObject[]toArray()Veraltet.<E> E[]toArray(E[] a) Von Klasse geerbte Methoden speiger.src.collections.objects.sets.ObjectOpenHashSet
add, addAll, addAll, addOrGet, contains, remove, size, trimVon Klasse geerbte Methoden speiger.src.collections.objects.sets.AbstractObjectSet
equals, hashCodeVon Klasse geerbte Methoden speiger.src.collections.objects.collections.AbstractObjectCollection
containsAll, containsAll, containsAny, containsAny, removeAll, removeAll, retainAll, retainAllVon Klasse geerbte Methoden java.util.AbstractCollection
isEmpty, removeAll, retainAll, toStringVon Schnittstelle geerbte Methoden java.util.Collection
parallelStream, removeIf, streamVon Schnittstelle geerbte Methoden speiger.src.collections.utils.ISizeProvider
sizeVon Schnittstelle geerbte Methoden speiger.src.collections.utils.ITrimmable
clearAndTrim, trimVon 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.ObjectOrderedSet
spliterator, synchronize, synchronize, unmodifiable
-
Konstruktordetails
-
ObjectLinkedOpenHashSet
public ObjectLinkedOpenHashSet()Default Constructor -
ObjectLinkedOpenHashSet
public ObjectLinkedOpenHashSet(int minCapacity) Constructor that defines the minimum capacity- Parameter:
minCapacity- the minimum capacity the HashSet is allowed to be.- Löst aus:
IllegalStateException- if the minimum capacity is negative
-
ObjectLinkedOpenHashSet
public ObjectLinkedOpenHashSet(int minCapacity, float loadFactor) Constructor that defines the minimum capacity and load factor- Parameter:
minCapacity- the minimum capacity the HashSet is allowed to be.loadFactor- the percentage of how full the backing array can be before they resize- Löst aus:
IllegalStateException- if the minimum capacity is negativeIllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
ObjectLinkedOpenHashSet
Helper constructor that allow to create a set from unboxed values- Parameter:
array- the elements that should be put into the set
-
ObjectLinkedOpenHashSet
Helper constructor that allow to create a set from unboxed values- Parameter:
array- the elements that should be put into the setloadFactor- the percentage of how full the backing array can be before they resize- Löst aus:
IllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
ObjectLinkedOpenHashSet
Helper constructor that allow to create a set from unboxed values- Parameter:
array- the elements that should be put into the setoffset- the starting index within the array that should be usedlength- the amount of elements used from the array- Löst aus:
IllegalStateException- if offset and length causes to step outside of the arrays range
-
ObjectLinkedOpenHashSet
Helper constructor that allow to create a set from unboxed values- Parameter:
array- the elements that should be put into the setoffset- the starting index within the array that should be usedlength- the amount of elements used from the arrayloadFactor- the percentage of how full the backing array can be before they resize- Löst aus:
IllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1IllegalStateException- if offset and length causes to step outside of the arrays range
-
ObjectLinkedOpenHashSet
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 Set
-
ObjectLinkedOpenHashSet
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 SetloadFactor- the percentage of how full the backing array can be before they resize- Löst aus:
IllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
ObjectLinkedOpenHashSet
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 Set
-
ObjectLinkedOpenHashSet
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 SetloadFactor- the percentage of how full the backing array can be before they resize- Löst aus:
IllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
ObjectLinkedOpenHashSet
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
-
ObjectLinkedOpenHashSet
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 setloadFactor- the percentage of how full the backing array can be before they resize- Löst aus:
IllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
-
Methodendetails
-
addAndMoveToFirst
Beschreibung aus Schnittstelle kopiert:ObjectOrderedSetA customized add method that allows you to insert into the first index.- Angegeben von:
addAndMoveToFirstin SchnittstelleObjectOrderedSet<T>- Parameter:
o- the element that should be inserted- Gibt zurück:
- true if it was added
- Siehe auch:
-
addAndMoveToLast
Beschreibung aus Schnittstelle kopiert:ObjectOrderedSetA customized add method that allows you to insert into the last index.- Angegeben von:
addAndMoveToLastin SchnittstelleObjectOrderedSet<T>- Parameter:
o- the element that should be inserted- Gibt zurück:
- true if it was added
- Siehe auch:
-
moveToFirst
Beschreibung aus Schnittstelle kopiert:ObjectOrderedSetA specific move method to move a given key to the first index.- Angegeben von:
moveToFirstin SchnittstelleObjectOrderedSet<T>- Parameter:
o- that should be moved to the first index- Gibt zurück:
- true if the value was moved.
-
moveToLast
Beschreibung aus Schnittstelle kopiert:ObjectOrderedSetA specific move method to move a given key to the last index.- Angegeben von:
moveToLastin SchnittstelleObjectOrderedSet<T>- Parameter:
o- that should be moved to the first last- Gibt zurück:
- true if the value was moved.
-
first
Beschreibung aus Schnittstelle kopiert:ObjectOrderedSetA method to get the first element in the set- Angegeben von:
firstin SchnittstelleObjectOrderedSet<T>- Gibt zurück:
- first element in the set
-
pollFirst
Beschreibung aus Schnittstelle kopiert:ObjectOrderedSetA method to get and remove the first element in the set- Angegeben von:
pollFirstin SchnittstelleObjectOrderedSet<T>- Gibt zurück:
- first element in the set
-
last
Beschreibung aus Schnittstelle kopiert:ObjectOrderedSetA method to get the last element in the set- Angegeben von:
lastin SchnittstelleObjectOrderedSet<T>- Gibt zurück:
- last element in the set
-
pollLast
Beschreibung aus Schnittstelle kopiert:ObjectOrderedSetA method to get and remove the last element in the set- Angegeben von:
pollLastin SchnittstelleObjectOrderedSet<T>- Gibt zurück:
- last element in the set
-
toArray
Veraltet.- Angegeben von:
toArrayin SchnittstelleCollection<T>- Angegeben von:
toArrayin SchnittstelleSet<T>- Setzt außer Kraft:
toArrayin KlasseObjectOpenHashSet<T>
-
toArray
public <E> E[] toArray(E[] a) - Angegeben von:
toArrayin SchnittstelleCollection<T>- Angegeben von:
toArrayin SchnittstelleSet<T>- Setzt außer Kraft:
toArrayin KlasseObjectOpenHashSet<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>- Setzt außer Kraft:
forEachIndexedin KlasseObjectOpenHashSet<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>- Setzt außer Kraft:
forEachin KlasseObjectOpenHashSet<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>- Setzt außer Kraft:
matchesAnyin KlasseObjectOpenHashSet<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>- Setzt außer Kraft:
matchesNonein KlasseObjectOpenHashSet<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>- Setzt außer Kraft:
matchesAllin KlasseObjectOpenHashSet<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>- Setzt außer Kraft:
reducein KlasseObjectOpenHashSet<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>- Setzt außer Kraft:
reducein KlasseObjectOpenHashSet<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>- Setzt außer Kraft:
findFirstin KlasseObjectOpenHashSet<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>- Setzt außer Kraft:
countin KlasseObjectOpenHashSet<T>- Parameter:
filter- that should be applied- Gibt zurück:
- the amount of Valid Elements
-
clear
public void clear()- Angegeben von:
clearin SchnittstelleCollection<T>- Angegeben von:
clearin SchnittstelleSet<T>- Setzt außer Kraft:
clearin KlasseObjectOpenHashSet<T>
-
clearAndTrim
public void clearAndTrim(int size) Beschreibung aus Schnittstelle kopiert:ITrimmableTrims the collection down to the requested size and clears all elements while doing so- Angegeben von:
clearAndTrimin SchnittstelleITrimmable- Setzt außer Kraft:
clearAndTrimin KlasseObjectOpenHashSet<T>- Parameter:
size- the amount of elements that should be allowed
-
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 SchnittstelleObjectCollection<T>- Angegeben von:
iteratorin SchnittstelleObjectIterable<T>- Angegeben von:
iteratorin SchnittstelleObjectOrderedSet<T>- Angegeben von:
iteratorin SchnittstelleObjectSet<T>- Angegeben von:
iteratorin SchnittstelleSet<T>- Setzt außer Kraft:
iteratorin KlasseObjectOpenHashSet<T>- Gibt zurück:
- a iterator of the collection
- Siehe auch:
-
iterator
Beschreibung aus Schnittstelle kopiert:ObjectOrderedSetA type Specific Iterator starting from a given key- Angegeben von:
iteratorin SchnittstelleObjectOrderedSet<T>- Parameter:
fromElement- the element the iterator should start from- Gibt zurück:
- a iterator starting from the given element
-
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 SchnittstelleObjectOrderedSet<T>- Angegeben von:
copyin SchnittstelleObjectSet<T>- Setzt außer Kraft:
copyin KlasseObjectOpenHashSet<T>- Gibt zurück:
- a Shallow Copy of the collection
-