Modul speiger.src.collections
Klasse ObjectOpenCustomHashSet<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.ObjectOpenCustomHashSet<T>
- Typparameter:
T- the keyType of elements maintained by this Collection
- Alle implementierten Schnittstellen:
Iterable<T>,Collection<T>,Set<T>,ObjectCollection<T>,ObjectIterable<T>,ObjectSet<T>,ISizeProvider,ITrimmable
- Bekannte direkte Unterklassen:
ObjectLinkedOpenCustomHashSet
A Type Specific HashSet that allows for custom HashControl.
For cases where Objects/primitive do not allow hashcoding this can be really useful and provide a lot of control.
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen speiger.src.collections.utils.ISizeProvider
ISizeProvider.CollectionSize -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungObjectOpenCustomHashSet(int minCapacity, float loadFactor, ObjectStrategy<? super T> strategy) Constructor that defines the minimum capacity and load factorObjectOpenCustomHashSet(int minCapacity, ObjectStrategy<? super T> strategy) Constructor that defines the minimum capacityObjectOpenCustomHashSet(Collection<? extends T> collection, float loadFactor, ObjectStrategy<? super T> strategy) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.ObjectOpenCustomHashSet(Collection<? extends T> collection, ObjectStrategy<? super T> strategy) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.ObjectOpenCustomHashSet(Iterator<T> iterator, float loadFactor, ObjectStrategy<? super T> strategy) A Helper constructor that allows to create a set from a iterator of an unknown sizeObjectOpenCustomHashSet(Iterator<T> iterator, ObjectStrategy<? super T> strategy) A Helper constructor that allows to create a set from a iterator of an unknown sizeObjectOpenCustomHashSet(ObjectCollection<T> collection, float loadFactor, ObjectStrategy<? super T> strategy) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.ObjectOpenCustomHashSet(ObjectCollection<T> collection, ObjectStrategy<? super T> strategy) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.ObjectOpenCustomHashSet(ObjectStrategy<? super T> strategy) Default ContstructorObjectOpenCustomHashSet(T[] array, float loadFactor, ObjectStrategy<? super T> strategy) Helper constructor that allow to create a set from unboxed valuesObjectOpenCustomHashSet(T[] array, int offset, int length, float loadFactor, ObjectStrategy<? super T> strategy) Helper constructor that allow to create a set from unboxed valuesObjectOpenCustomHashSet(T[] array, int offset, int length, ObjectStrategy<? super T> strategy) Helper constructor that allow to create a set from unboxed valuesObjectOpenCustomHashSet(T[] array, ObjectStrategy<? super T> strategy) Helper constructor that allow to create a set from unboxed values -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanbooleanaddAll(Collection<? extends T> c) booleanaddAll(ObjectCollection<T> c) A Type-Specific addAll function to reduce (un)boxingA Helper method that allows to add a element or getting the already present implement.voidclear()voidclearAndTrim(int size) Trims the collection down to the requested size and clears all elements while doing sobooleancopy()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.<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.ObjectStrategy<? super T>Helper getter function to get the current strategyiterator()Returns a Type-Specific Iterator to reduce (un)boxingbooleanmatchesAll(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.<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 Iterablebooleanintsize()Object[]toArray()Veraltet.<E> E[]toArray(E[] a) booleantrim(int size) Trims the original collection down to the size of the current elements or the requested size depending which is biggerVon 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.ITrimmable
clearAndTrim, trimVon Schnittstelle geerbte Methoden speiger.src.collections.objects.collections.ObjectCollection
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.ObjectSet
spliterator, synchronize, synchronize, unmodifiableVon Schnittstelle geerbte Methoden java.util.Set
containsAll, isEmpty, removeAll, retainAll
-
Konstruktordetails
-
ObjectOpenCustomHashSet
Default Contstructor- Parameter:
strategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is null
-
ObjectOpenCustomHashSet
Constructor that defines the minimum capacity- Parameter:
minCapacity- the minimum capacity the HashSet is allowed to be.strategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is nullIllegalStateException- if the minimum capacity is negative
-
ObjectOpenCustomHashSet
public ObjectOpenCustomHashSet(int minCapacity, float loadFactor, ObjectStrategy<? super T> strategy) 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 resizestrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is nullIllegalStateException- if the minimum capacity is negativeIllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
ObjectOpenCustomHashSet
Helper constructor that allow to create a set from unboxed values- Parameter:
array- the elements that should be put into the setstrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is null
-
ObjectOpenCustomHashSet
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 resizestrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is nullIllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
ObjectOpenCustomHashSet
public ObjectOpenCustomHashSet(T[] array, int offset, int length, ObjectStrategy<? super T> strategy) 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 arraystrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is nullIllegalStateException- if offset and length causes to step outside of the arrays range
-
ObjectOpenCustomHashSet
public ObjectOpenCustomHashSet(T[] array, int offset, int length, float loadFactor, ObjectStrategy<? super T> strategy) 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 resizestrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is nullIllegalStateException- 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
-
ObjectOpenCustomHashSet
public ObjectOpenCustomHashSet(Collection<? extends T> collection, ObjectStrategy<? super T> strategy) 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 Setstrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is null
-
ObjectOpenCustomHashSet
public ObjectOpenCustomHashSet(Collection<? extends T> collection, float loadFactor, ObjectStrategy<? super T> strategy) 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 resizestrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is nullIllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
ObjectOpenCustomHashSet
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 Setstrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is null
-
ObjectOpenCustomHashSet
public ObjectOpenCustomHashSet(ObjectCollection<T> collection, float loadFactor, ObjectStrategy<? super T> strategy) 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 resizestrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is nullIllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
ObjectOpenCustomHashSet
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 setstrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is null
-
ObjectOpenCustomHashSet
public ObjectOpenCustomHashSet(Iterator<T> iterator, float loadFactor, ObjectStrategy<? super T> strategy) 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 resizestrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is nullIllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
-
Methodendetails
-
getStrategy
Helper getter function to get the current strategy- Gibt zurück:
- the current strategy
-
add
- Angegeben von:
addin SchnittstelleCollection<T>- Angegeben von:
addin SchnittstelleSet<T>- Setzt außer Kraft:
addin KlasseAbstractCollection<T>
-
addOrGet
Beschreibung aus Schnittstelle kopiert:ObjectSetA Helper method that allows to add a element or getting the already present implement. Allowing to make unique references reuseable. -
addAll
- Angegeben von:
addAllin SchnittstelleCollection<T>- Angegeben von:
addAllin SchnittstelleSet<T>- Setzt außer Kraft:
addAllin KlasseAbstractCollection<T>
-
addAll
Beschreibung aus Schnittstelle kopiert:ObjectCollectionA Type-Specific addAll function to reduce (un)boxing- Angegeben von:
addAllin SchnittstelleObjectCollection<T>- Setzt außer Kraft:
addAllin KlasseAbstractObjectCollection<T>- Parameter:
c- the collection of elements that should be added- Gibt zurück:
- true if elements were added into the collection
-
contains
- Angegeben von:
containsin SchnittstelleCollection<T>- Angegeben von:
containsin SchnittstelleSet<T>- Setzt außer Kraft:
containsin KlasseAbstractCollection<T>
-
remove
- Angegeben von:
removein SchnittstelleCollection<T>- Angegeben von:
removein SchnittstelleSet<T>- Setzt außer Kraft:
removein KlasseAbstractCollection<T>
-
trim
public boolean trim(int size) Beschreibung aus Schnittstelle kopiert:ITrimmableTrims the original collection down to the size of the current elements or the requested size depending which is bigger- Angegeben von:
trimin SchnittstelleITrimmable- Parameter:
size- the requested trim size.- Gibt zurück:
- if the internal array has been trimmed.
-
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- 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 SchnittstelleObjectSet<T>- Angegeben von:
iteratorin SchnittstelleSet<T>- Angegeben von:
iteratorin KlasseAbstractObjectSet<T>- Gibt zurück:
- a iterator of the collection
- Siehe auch:
-
toArray
Veraltet.- Angegeben von:
toArrayin SchnittstelleCollection<T>- Angegeben von:
toArrayin SchnittstelleSet<T>- Setzt außer Kraft:
toArrayin KlasseAbstractCollection<T>
-
toArray
public <E> E[] toArray(E[] a) - Angegeben von:
toArrayin SchnittstelleCollection<T>- Angegeben von:
toArrayin SchnittstelleSet<T>- Setzt außer Kraft:
toArrayin KlasseAbstractCollection<T>
-
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 SchnittstelleObjectSet<T>- Setzt außer Kraft:
copyin KlasseAbstractObjectSet<T>- Gibt zurück:
- a Shallow Copy of the collection
-
clear
public void clear()- Angegeben von:
clearin SchnittstelleCollection<T>- Angegeben von:
clearin SchnittstelleSet<T>- Setzt außer Kraft:
clearin KlasseAbstractCollection<T>
-
size
public int size()- Angegeben von:
sizein SchnittstelleCollection<T>- Angegeben von:
sizein SchnittstelleISizeProvider- Angegeben von:
sizein SchnittstelleSet<T>- Angegeben von:
sizein KlasseAbstractCollection<T>- Gibt zurück:
- the size of the implementing Collection
-
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>- 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>- 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>- 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>- 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>- 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>- 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>- 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>- 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>- Parameter:
filter- that should be applied- Gibt zurück:
- the amount of Valid Elements
-