java.lang.Object
java.util.AbstractCollection<Integer>
speiger.src.collections.ints.collections.AbstractIntCollection
speiger.src.collections.ints.sets.AbstractIntSet
speiger.src.collections.ints.sets.IntOpenHashSet
- Alle implementierten Schnittstellen:
Iterable<Integer>,Collection<Integer>,Set<Integer>,IntCollection,IntIterable,IntSet,ISizeProvider,ITrimmable
- Bekannte direkte Unterklassen:
IntLinkedOpenHashSet
A Type Specific Custom implementation of the HashSet
Instead of using Wrapper Object Arrays for storing keys and values there is dedicated arrays for storing keys.
Extra to that there is a couple quality of life functions provided
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen speiger.src.collections.utils.ISizeProvider
ISizeProvider.CollectionSize -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungDefault ConstructorIntOpenHashSet(int minCapacity) Constructor that defines the minimum capacityIntOpenHashSet(int[] array) Helper constructor that allow to create a set from unboxed valuesIntOpenHashSet(int[] array, float loadFactor) Helper constructor that allow to create a set from unboxed valuesIntOpenHashSet(int[] array, int offset, int length) Helper constructor that allow to create a set from unboxed valuesIntOpenHashSet(int[] array, int offset, int length, float loadFactor) Helper constructor that allow to create a set from unboxed valuesIntOpenHashSet(int minCapacity, float loadFactor) Constructor that defines the minimum capacity and load factorIntOpenHashSet(Collection<? extends Integer> collection) Veraltet.IntOpenHashSet(Collection<? extends Integer> collection, float loadFactor) Veraltet.IntOpenHashSet(Iterator<Integer> iterator) A Helper constructor that allows to create a set from a iterator of an unknown sizeIntOpenHashSet(Iterator<Integer> iterator, float loadFactor) A Helper constructor that allows to create a set from a iterator of an unknown sizeIntOpenHashSet(IntCollection collection) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.IntOpenHashSet(IntCollection collection, float loadFactor) A Helper constructor that allows to create a Set with exactly the same values as the provided collection.IntOpenHashSet(IntIterator iterator) A Helper constructor that allows to create a set from a iterator of an unknown sizeIntOpenHashSet(IntIterator iterator, float loadFactor) A Helper constructor that allows to create a set from a iterator of an unknown size -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanadd(int o) A Type-Specific add function to reduce (un)boxingbooleanaddAll(Collection<? extends Integer> c) Veraltet.booleanA Type-Specific addAll function to reduce (un)boxingvoidclear()voidclearAndTrim(int size) Trims the collection down to the requested size and clears all elements while doing sobooleancontains(int o) A Type-Specific implementation of contains.booleancopy()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.<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)boxingbooleanmatchesAll(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.intreduce(int identity, IntIntUnaryOperator operator) Performs a reduction on the elements of this Iterableintreduce(IntIntUnaryOperator operator) Performs a reduction on the elements of this Iterablebooleanremove(int o) A Type Specific remove function to reduce boxing/unboxingbooleanintsize()Object[]toArray()Veraltet.<E> E[]toArray(E[] a) Veraltet.int[]toIntArray(int[] a) A Type-Specific implementation of toArray.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.ints.sets.AbstractIntSet
equals, hashCodeVon Klasse geerbte Methoden speiger.src.collections.ints.collections.AbstractIntCollection
add, containsAll, containsAll, containsAny, containsAny, remInt, 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
addAll, addAll, addAll, 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.IntSet
add, remInt, spliterator, synchronize, synchronize, unmodifiableVon Schnittstelle geerbte Methoden speiger.src.collections.utils.ITrimmable
clearAndTrim, trimVon Schnittstelle geerbte Methoden java.util.Set
containsAll, isEmpty, removeAll, retainAll
-
Konstruktordetails
-
IntOpenHashSet
public IntOpenHashSet()Default Constructor -
IntOpenHashSet
public IntOpenHashSet(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
-
IntOpenHashSet
public IntOpenHashSet(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
-
IntOpenHashSet
public IntOpenHashSet(int[] array) Helper constructor that allow to create a set from unboxed values- Parameter:
array- the elements that should be put into the set
-
IntOpenHashSet
public IntOpenHashSet(int[] array, float loadFactor) 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
-
IntOpenHashSet
public IntOpenHashSet(int[] array, int offset, int length) 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
-
IntOpenHashSet
public IntOpenHashSet(int[] array, int offset, int length, float loadFactor) 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
-
IntOpenHashSet
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 Set
-
IntOpenHashSet
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 resize- Löst aus:
IllegalStateException- if the loadfactor is either below/equal to 0 or above/equal to 1
-
IntOpenHashSet
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
-
IntOpenHashSet
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
-
IntOpenHashSet
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
-
IntOpenHashSet
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
-
IntOpenHashSet
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
-
IntOpenHashSet
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
-
add
public boolean add(int o) Beschreibung aus Schnittstelle kopiert:IntCollectionA Type-Specific add function to reduce (un)boxing- Angegeben von:
addin SchnittstelleIntCollection- Parameter:
o- the element that should be added- Gibt zurück:
- true if the element was added to the collection
-
addAll
Veraltet.Beschreibung aus Klasse kopiert:AbstractIntCollectionThis default implementation delegates to the corresponding type-specific function.
- Angegeben von:
addAllin SchnittstelleCollection<Integer>- Angegeben von:
addAllin SchnittstelleSet<Integer>- Setzt außer Kraft:
addAllin KlasseAbstractIntCollection
-
addAll
Beschreibung aus Schnittstelle kopiert:IntCollectionA Type-Specific addAll function to reduce (un)boxing- Angegeben von:
addAllin SchnittstelleIntCollection- Setzt außer Kraft:
addAllin KlasseAbstractIntCollection- Parameter:
c- the collection of elements that should be added- Gibt zurück:
- true if elements were added into the collection
-
contains
Beschreibung aus Klasse kopiert:AbstractIntCollectionThis default implementation delegates to the corresponding type-specific function.
This default implementation delegates to the corresponding type-specific function.
- Angegeben von:
containsin SchnittstelleCollection<Integer>- Angegeben von:
containsin SchnittstelleIntCollection- Angegeben von:
containsin SchnittstelleIntSet- Angegeben von:
containsin SchnittstelleSet<Integer>- Setzt außer Kraft:
containsin KlasseAbstractIntCollection
-
remove
Beschreibung aus Klasse kopiert:AbstractIntCollectionThis default implementation delegates to the corresponding type-specific function.
This default implementation delegates to the corresponding type-specific function.
- Angegeben von:
removein SchnittstelleCollection<Integer>- Angegeben von:
removein SchnittstelleIntCollection- Angegeben von:
removein SchnittstelleIntSet- Angegeben von:
removein SchnittstelleSet<Integer>- Setzt außer Kraft:
removein KlasseAbstractIntCollection
-
contains
public boolean contains(int o) Beschreibung aus Klasse kopiert:AbstractIntCollectionA Type-Specific implementation of contains. This implementation iterates over the elements and returns true if the value match.- Angegeben von:
containsin SchnittstelleIntCollection- Setzt außer Kraft:
containsin KlasseAbstractIntCollection- Parameter:
o- the element that should be searched for.- Gibt zurück:
- true if the value was found.
-
remove
public boolean remove(int o) Beschreibung aus Schnittstelle kopiert:IntSetA Type Specific remove function to reduce boxing/unboxing -
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
-
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 KlasseAbstractIntCollection- 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 KlasseAbstractCollection<Integer>
-
toArray
Veraltet.- Angegeben von:
toArrayin SchnittstelleCollection<Integer>- Angegeben von:
toArrayin SchnittstelleSet<Integer>- Setzt außer Kraft:
toArrayin KlasseAbstractCollection<Integer>
-
forEach
Beschreibung aus Schnittstelle kopiert:IntIterableA Type Specific foreach function that reduces (un)boxing- Angegeben von:
forEachin SchnittstelleIntIterable- 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- 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- 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- 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- 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- 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- 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- 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- 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- 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 SchnittstelleIntSet- Angegeben von:
iteratorin SchnittstelleIterable<Integer>- Angegeben von:
iteratorin SchnittstelleSet<Integer>- Angegeben von:
iteratorin KlasseAbstractIntSet- Gibt zurück:
- a iterator of the collection
- Siehe auch:
-
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 SchnittstelleIntSet- Setzt außer Kraft:
copyin KlasseAbstractIntSet- Gibt zurück:
- a Shallow Copy of the collection
-
clear
public void clear()- Angegeben von:
clearin SchnittstelleCollection<Integer>- Angegeben von:
clearin SchnittstelleSet<Integer>- Setzt außer Kraft:
clearin KlasseAbstractCollection<Integer>
-
size
public int size()- Angegeben von:
sizein SchnittstelleCollection<Integer>- Angegeben von:
sizein SchnittstelleISizeProvider- Angegeben von:
sizein SchnittstelleSet<Integer>- Angegeben von:
sizein KlasseAbstractCollection<Integer>- Gibt zurück:
- the size of the implementing Collection
-