T - the keyType of elements maintained by this Collectionpublic class ObjectOpenCustomHashSet<T> extends AbstractObjectSet<T> implements ITrimmable
ISizeProvider.CollectionSize| Constructor and Description |
|---|
ObjectOpenCustomHashSet(java.util.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(java.util.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(int minCapacity,
float loadFactor,
ObjectStrategy<? super T> strategy)
Constructor that defines the minimum capacity and load factor
|
ObjectOpenCustomHashSet(int minCapacity,
ObjectStrategy<? super T> strategy)
Constructor that defines the minimum capacity
|
ObjectOpenCustomHashSet(java.util.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
|
ObjectOpenCustomHashSet(java.util.Iterator<T> iterator,
ObjectStrategy<? super T> strategy)
A Helper constructor that allows to create a set from a iterator of an unknown size
|
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.
|
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 Contstructor
|
ObjectOpenCustomHashSet(T[] array,
float loadFactor,
ObjectStrategy<? super T> strategy)
Helper constructor that allow to create a set from unboxed values
|
ObjectOpenCustomHashSet(T[] array,
int offset,
int length,
float loadFactor,
ObjectStrategy<? super T> strategy)
Helper constructor that allow to create a set from unboxed values
|
ObjectOpenCustomHashSet(T[] array,
int offset,
int length,
ObjectStrategy<? super T> strategy)
Helper constructor that allow to create a set from unboxed values
|
ObjectOpenCustomHashSet(T[] array,
ObjectStrategy<? super T> strategy)
Helper constructor that allow to create a set from unboxed values
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T o) |
boolean |
addAll(java.util.Collection<? extends T> c) |
boolean |
addAll(ObjectCollection<T> c)
A Type-Specific addAll function to reduce (un)boxing
|
T |
addOrGet(T o)
A Helper method that allows to add a element or getting the already present implement.
|
void |
clear() |
void |
clearAndTrim(int size)
Trims the collection down to the requested size and clears all elements while doing so
|
boolean |
contains(java.lang.Object o) |
ObjectOpenCustomHashSet<T> |
copy()
A Function that does a shallow clone of the Collection itself.
|
int |
count(java.util.function.Predicate<T> filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
T |
findFirst(java.util.function.Predicate<T> filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
void |
forEach(java.util.function.Consumer<? super T> action) |
<E> void |
forEach(E input,
ObjectObjectConsumer<E,T> action)
Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
|
void |
forEachIndexed(IntObjectConsumer<T> action)
A Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.
|
ObjectStrategy<? super T> |
getStrategy()
Helper getter function to get the current strategy
|
ObjectIterator<T> |
iterator()
Returns a Type-Specific Iterator to reduce (un)boxing
|
boolean |
matchesAll(java.util.function.Predicate<T> filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(java.util.function.Predicate<T> filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(java.util.function.Predicate<T> filter)
Helper function to reduce stream usage that allows to filter for no matches.
|
<E> E |
reduce(E identity,
java.util.function.BiFunction<E,T,E> operator)
Performs a reduction on the
elements of this Iterable
|
T |
reduce(ObjectObjectUnaryOperator<T,T> operator)
Performs a reduction on the
elements of this Iterable
|
boolean |
remove(java.lang.Object o) |
int |
size() |
boolean |
trim(int size)
Trims the original collection down to the size of the current elements or the requested size depending which is bigger
|
equals, hashCodecontainsAll, containsAll, containsAny, containsAny, removeAll, removeAll, retainAll, retainAllisEmpty, removeAll, retainAll, toArray, toArray, toStringclearAndTrim, trimspliterator, synchronize, synchronize, unmodifiablecontainsAll, isEmpty, removeAll, retainAll, toArray, toArrayaddAll, addAll, addAll, containsAll, containsAny, containsAny, pour, removeAll, removeAll, retainAll, retainAll, toArrayarrayflatMap, asAsync, distinct, filter, flatMap, limit, map, peek, pourAsList, pourAsSet, repeat, sortedofpublic ObjectOpenCustomHashSet(ObjectStrategy<? super T> strategy)
strategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic ObjectOpenCustomHashSet(int minCapacity,
ObjectStrategy<? super T> strategy)
minCapacity - the minimum capacity the HashSet is allowed to be.strategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the minimum capacity is negativepublic ObjectOpenCustomHashSet(int minCapacity,
float loadFactor,
ObjectStrategy<? super T> strategy)
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.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the minimum capacity is negativejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public ObjectOpenCustomHashSet(T[] array, ObjectStrategy<? super T> strategy)
array - the elements that should be put into the setstrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic ObjectOpenCustomHashSet(T[] array, float loadFactor, ObjectStrategy<? super T> strategy)
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.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public ObjectOpenCustomHashSet(T[] array, int offset, int length, ObjectStrategy<? super T> strategy)
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.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if offset and length causes to step outside of the arrays rangepublic ObjectOpenCustomHashSet(T[] array, int offset, int length, float loadFactor, ObjectStrategy<? super T> strategy)
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.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1java.lang.IllegalStateException - if offset and length causes to step outside of the arrays rangepublic ObjectOpenCustomHashSet(java.util.Collection<? extends T> collection, ObjectStrategy<? super T> strategy)
collection - the set the elements should be added to the Setstrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic ObjectOpenCustomHashSet(java.util.Collection<? extends T> collection, float loadFactor, ObjectStrategy<? super T> strategy)
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.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public ObjectOpenCustomHashSet(ObjectCollection<T> collection, ObjectStrategy<? super T> strategy)
collection - the set the elements should be added to the Setstrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic ObjectOpenCustomHashSet(ObjectCollection<T> collection, float loadFactor, ObjectStrategy<? super T> strategy)
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.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public ObjectOpenCustomHashSet(java.util.Iterator<T> iterator, ObjectStrategy<? super T> strategy)
iterator - the elements that should be added to the setstrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic ObjectOpenCustomHashSet(java.util.Iterator<T> iterator, float loadFactor, ObjectStrategy<? super T> strategy)
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.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public ObjectStrategy<? super T> getStrategy()
public boolean add(T o)
public T addOrGet(T o)
ObjectSetpublic boolean addAll(java.util.Collection<? extends T> c)
public boolean addAll(ObjectCollection<T> c)
ObjectCollectionaddAll in interface ObjectCollection<T>addAll in class AbstractObjectCollection<T>c - the collection of elements that should be addedpublic boolean contains(java.lang.Object o)
public boolean remove(java.lang.Object o)
public boolean trim(int size)
ITrimmabletrim in interface ITrimmablesize - the requested trim size.public void clearAndTrim(int size)
ITrimmableclearAndTrim in interface ITrimmablesize - the amount of elements that should be allowedpublic ObjectIterator<T> iterator()
ObjectCollectioniterator in interface java.lang.Iterable<T>iterator in interface java.util.Collection<T>iterator in interface java.util.Set<T>iterator in interface ObjectCollection<T>iterator in interface ObjectIterable<T>iterator in interface ObjectSet<T>iterator in class AbstractObjectSet<T>Collection.iterator()public ObjectOpenCustomHashSet<T> copy()
ObjectCollectioncopy in interface ObjectCollection<T>copy in interface ObjectSet<T>copy in class AbstractObjectSet<T>public void clear()
public int size()
size in interface java.util.Collection<T>size in interface java.util.Set<T>size in interface ISizeProvidersize in class java.util.AbstractCollection<T>public void forEach(java.util.function.Consumer<? super T> action)
forEach in interface java.lang.Iterable<T>public void forEachIndexed(IntObjectConsumer<T> action)
ObjectIterableforEachIndexed in interface ObjectIterable<T>action - The action to be performed for each elementpublic <E> void forEach(E input,
ObjectObjectConsumer<E,T> action)
ObjectIterableforEach in interface ObjectIterable<T>E - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementpublic boolean matchesAny(java.util.function.Predicate<T> filter)
ObjectIterablematchesAny in interface ObjectIterable<T>filter - that should be appliedpublic boolean matchesNone(java.util.function.Predicate<T> filter)
ObjectIterablematchesNone in interface ObjectIterable<T>filter - that should be appliedpublic boolean matchesAll(java.util.function.Predicate<T> filter)
ObjectIterablematchesAll in interface ObjectIterable<T>filter - that should be appliedpublic <E> E reduce(E identity,
java.util.function.BiFunction<E,T,E> operator)
ObjectIterablereduce in interface ObjectIterable<T>E - the keyType of elements maintained by this Collectionidentity - the start valueoperator - the operation that should be appliedpublic T reduce(ObjectObjectUnaryOperator<T,T> operator)
ObjectIterablereduce in interface ObjectIterable<T>operator - the operation that should be appliedpublic T findFirst(java.util.function.Predicate<T> filter)
ObjectIterablefindFirst in interface ObjectIterable<T>filter - that should be appliedpublic int count(java.util.function.Predicate<T> filter)
ObjectIterablecount in interface ObjectIterable<T>filter - that should be applied