Modul speiger.src.collections
Klasse IntLinkedOpenCustomHashSet
java.lang.Object
java.util.AbstractCollection<Integer>
speiger.src.collections.ints.collections.AbstractIntCollection
speiger.src.collections.ints.sets.AbstractIntSet
speiger.src.collections.ints.sets.IntOpenCustomHashSet
speiger.src.collections.ints.sets.IntLinkedOpenCustomHashSet
- Alle implementierten Schnittstellen:
Iterable<Integer>,Collection<Integer>,Set<Integer>,IntCollection,IntIterable,IntOrderedSet,IntSet,ISizeProvider,ITrimmable
A Type Specific LinkedHashSet that allows for custom HashControl. That uses arrays to create links between nodes.
For cases where Objects/primitive do not allow hashcoding this can be really useful and provide a lot of control.
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
KonstruktorenKonstruktorBeschreibungIntLinkedOpenCustomHashSet(int[] array, float loadFactor, IntStrategy strategy) Helper constructor that allow to create a set from unboxed valuesIntLinkedOpenCustomHashSet(int[] array, int offset, int length, float loadFactor, IntStrategy strategy) Helper constructor that allow to create a set from unboxed valuesIntLinkedOpenCustomHashSet(int[] array, int offset, int length, IntStrategy strategy) Helper constructor that allow to create a set from unboxed valuesIntLinkedOpenCustomHashSet(int[] array, IntStrategy strategy) Helper constructor that allow to create a set from unboxed valuesIntLinkedOpenCustomHashSet(int minCapacity, float loadFactor, IntStrategy strategy) Constructor that defines the minimum capacity and load factorIntLinkedOpenCustomHashSet(int minCapacity, IntStrategy strategy) Constructor that defines the minimum capacityIntLinkedOpenCustomHashSet(Collection<? extends Integer> collection, float loadFactor, IntStrategy strategy) Veraltet.IntLinkedOpenCustomHashSet(Collection<? extends Integer> collection, IntStrategy strategy) Veraltet.IntLinkedOpenCustomHashSet(Iterator<Integer> iterator, float loadFactor, IntStrategy strategy) A Helper constructor that allows to create a set from a iterator of an unknown sizeIntLinkedOpenCustomHashSet(Iterator<Integer> iterator, IntStrategy strategy) A Helper constructor that allows to create a set from a iterator of an unknown sizeIntLinkedOpenCustomHashSet(IntCollection collection, float loadFactor, IntStrategy strategy) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.IntLinkedOpenCustomHashSet(IntCollection collection, IntStrategy strategy) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.IntLinkedOpenCustomHashSet(IntIterator iterator, float loadFactor, IntStrategy strategy) A Helper constructor that allows to create a set from a iterator of an unknown sizeIntLinkedOpenCustomHashSet(IntIterator iterator, IntStrategy strategy) A Helper constructor that allows to create a set from a iterator of an unknown sizeIntLinkedOpenCustomHashSet(IntStrategy strategy) Default Contstructor -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanaddAndMoveToFirst(int o) A customized add method that allows you to insert into the first index.booleanaddAndMoveToLast(int o) A 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.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 set<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.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 setbooleanmatchesAll(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.booleanmoveToFirst(int o) A specific move method to move a given key to the first index.booleanmoveToLast(int o) A specific move method to move a given key to the last index.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 IterableObject[]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.IntOpenCustomHashSet
add, addAll, addAll, contains, getStrategy, remove, size, trimVon Klasse geerbte Methoden speiger.src.collections.ints.sets.AbstractIntSet
equals, hashCodeVon Klasse geerbte Methoden speiger.src.collections.ints.collections.AbstractIntCollection
add, contains, containsAll, containsAll, containsAny, containsAny, remInt, remove, 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
add, addAll, addAll, addAll, addAll, contains, 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.IntOrderedSet
spliterator, synchronize, synchronize, unmodifiableVon Schnittstelle geerbte Methoden speiger.src.collections.ints.sets.IntSet
add, contains, remInt, remove, removeVon Schnittstelle geerbte Methoden speiger.src.collections.utils.ISizeProvider
sizeVon Schnittstelle geerbte Methoden speiger.src.collections.utils.ITrimmable
clearAndTrim, trim
-
Konstruktordetails
-
IntLinkedOpenCustomHashSet
Default Contstructor- Parameter:
strategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is null
-
IntLinkedOpenCustomHashSet
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
-
IntLinkedOpenCustomHashSet
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
-
IntLinkedOpenCustomHashSet
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
-
IntLinkedOpenCustomHashSet
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
-
IntLinkedOpenCustomHashSet
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
-
IntLinkedOpenCustomHashSet
public IntLinkedOpenCustomHashSet(int[] array, int offset, int length, float loadFactor, IntStrategy 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
-
IntLinkedOpenCustomHashSet
@Deprecated public IntLinkedOpenCustomHashSet(Collection<? extends Integer> collection, IntStrategy strategy) 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 Setstrategy- the strategy that allows hash control.- Löst aus:
NullPointerException- if Strategy is null
-
IntLinkedOpenCustomHashSet
@Deprecated public IntLinkedOpenCustomHashSet(Collection<? extends Integer> collection, float loadFactor, IntStrategy strategy) 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 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
-
IntLinkedOpenCustomHashSet
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
-
IntLinkedOpenCustomHashSet
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
-
IntLinkedOpenCustomHashSet
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
-
IntLinkedOpenCustomHashSet
public IntLinkedOpenCustomHashSet(Iterator<Integer> iterator, float loadFactor, IntStrategy 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
-
IntLinkedOpenCustomHashSet
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
-
IntLinkedOpenCustomHashSet
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
-
addAndMoveToFirst
public boolean addAndMoveToFirst(int o) Beschreibung aus Schnittstelle kopiert:IntOrderedSetA customized add method that allows you to insert into the first index.- Angegeben von:
addAndMoveToFirstin SchnittstelleIntOrderedSet- Parameter:
o- the element that should be inserted- Gibt zurück:
- true if it was added
- Siehe auch:
-
addAndMoveToLast
public boolean addAndMoveToLast(int o) Beschreibung aus Schnittstelle kopiert:IntOrderedSetA customized add method that allows you to insert into the last index.- Angegeben von:
addAndMoveToLastin SchnittstelleIntOrderedSet- Parameter:
o- the element that should be inserted- Gibt zurück:
- true if it was added
- Siehe auch:
-
moveToFirst
public boolean moveToFirst(int o) Beschreibung aus Schnittstelle kopiert:IntOrderedSetA specific move method to move a given key to the first index.- Angegeben von:
moveToFirstin SchnittstelleIntOrderedSet- Parameter:
o- that should be moved to the first index- Gibt zurück:
- true if the value was moved.
-
moveToLast
public boolean moveToLast(int o) Beschreibung aus Schnittstelle kopiert:IntOrderedSetA specific move method to move a given key to the last index.- Angegeben von:
moveToLastin SchnittstelleIntOrderedSet- Parameter:
o- that should be moved to the first last- Gibt zurück:
- true if the value was moved.
-
firstInt
public int firstInt()Beschreibung aus Schnittstelle kopiert:IntOrderedSetA method to get the first element in the set- Angegeben von:
firstIntin SchnittstelleIntOrderedSet- Gibt zurück:
- first element in the set
-
pollFirstInt
public int pollFirstInt()Beschreibung aus Schnittstelle kopiert:IntOrderedSetA method to get and remove the first element in the set- Angegeben von:
pollFirstIntin SchnittstelleIntOrderedSet- Gibt zurück:
- first element in the set
-
lastInt
public int lastInt()Beschreibung aus Schnittstelle kopiert:IntOrderedSetA method to get the last element in the set- Angegeben von:
lastIntin SchnittstelleIntOrderedSet- Gibt zurück:
- last element in the set
-
pollLastInt
public int pollLastInt()Beschreibung aus Schnittstelle kopiert:IntOrderedSetA method to get and remove the last element in the set- Angegeben von:
pollLastIntin SchnittstelleIntOrderedSet- Gibt zurück:
- last element in the set
-
clear
public void clear()- Angegeben von:
clearin SchnittstelleCollection<Integer>- Angegeben von:
clearin SchnittstelleSet<Integer>- Setzt außer Kraft:
clearin KlasseIntOpenCustomHashSet
-
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 KlasseIntOpenCustomHashSet- Parameter:
size- the amount of elements that should be allowed
-
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 KlasseIntOpenCustomHashSet- 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 KlasseIntOpenCustomHashSet
-
toArray
Veraltet.- Angegeben von:
toArrayin SchnittstelleCollection<Integer>- Angegeben von:
toArrayin SchnittstelleSet<Integer>- Setzt außer Kraft:
toArrayin KlasseIntOpenCustomHashSet
-
forEach
Beschreibung aus Schnittstelle kopiert:IntIterableA Type Specific foreach function that reduces (un)boxing- Angegeben von:
forEachin SchnittstelleIntIterable- Setzt außer Kraft:
forEachin KlasseIntOpenCustomHashSet- 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- Setzt außer Kraft:
forEachIndexedin KlasseIntOpenCustomHashSet- 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- Setzt außer Kraft:
forEachin KlasseIntOpenCustomHashSet- 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- Setzt außer Kraft:
matchesAnyin KlasseIntOpenCustomHashSet- 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- Setzt außer Kraft:
matchesNonein KlasseIntOpenCustomHashSet- 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- Setzt außer Kraft:
matchesAllin KlasseIntOpenCustomHashSet- 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- Setzt außer Kraft:
reducein KlasseIntOpenCustomHashSet- 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- Setzt außer Kraft:
reducein KlasseIntOpenCustomHashSet- 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- Setzt außer Kraft:
findFirstin KlasseIntOpenCustomHashSet- 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- Setzt außer Kraft:
countin KlasseIntOpenCustomHashSet- Parameter:
filter- that should be applied- Gibt zurück:
- the amount of Valid Elements
-
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 SchnittstelleIntOrderedSet- Angegeben von:
iteratorin SchnittstelleIntSet- Angegeben von:
iteratorin SchnittstelleIterable<Integer>- Angegeben von:
iteratorin SchnittstelleSet<Integer>- Setzt außer Kraft:
iteratorin KlasseIntOpenCustomHashSet- Gibt zurück:
- a iterator of the collection
- Siehe auch:
-
iterator
Beschreibung aus Schnittstelle kopiert:IntOrderedSetA type Specific Iterator starting from a given key- Angegeben von:
iteratorin SchnittstelleIntOrderedSet- Parameter:
fromElement- the element the iterator should start from- Gibt zurück:
- a iterator starting from the given element
-
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 SchnittstelleIntOrderedSet- Angegeben von:
copyin SchnittstelleIntSet- Setzt außer Kraft:
copyin KlasseIntOpenCustomHashSet- Gibt zurück:
- a Shallow Copy of the collection
-