T - the keyType of elements maintained by this Collectionpublic class ObjectLinkedOpenCustomHashSet<T> extends ObjectOpenCustomHashSet<T> implements ObjectOrderedSet<T>
ISizeProvider.CollectionSize| Constructor and Description |
|---|
ObjectLinkedOpenCustomHashSet(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.
|
ObjectLinkedOpenCustomHashSet(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.
|
ObjectLinkedOpenCustomHashSet(int minCapacity,
float loadFactor,
ObjectStrategy<? super T> strategy)
Constructor that defines the minimum capacity and load factor
|
ObjectLinkedOpenCustomHashSet(int minCapacity,
ObjectStrategy<? super T> strategy)
Constructor that defines the minimum capacity
|
ObjectLinkedOpenCustomHashSet(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
|
ObjectLinkedOpenCustomHashSet(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
|
ObjectLinkedOpenCustomHashSet(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.
|
ObjectLinkedOpenCustomHashSet(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.
|
ObjectLinkedOpenCustomHashSet(ObjectStrategy<? super T> strategy)
Default Contstructor
|
ObjectLinkedOpenCustomHashSet(T[] array,
float loadFactor,
ObjectStrategy<? super T> strategy)
Helper constructor that allow to create a set from unboxed values
|
ObjectLinkedOpenCustomHashSet(T[] array,
int offset,
int length,
float loadFactor,
ObjectStrategy<? super T> strategy)
Helper constructor that allow to create a set from unboxed values
|
ObjectLinkedOpenCustomHashSet(T[] array,
int offset,
int length,
ObjectStrategy<? super T> strategy)
Helper constructor that allow to create a set from unboxed values
|
ObjectLinkedOpenCustomHashSet(T[] array,
ObjectStrategy<? super T> strategy)
Helper constructor that allow to create a set from unboxed values
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAndMoveToFirst(T o)
A customized add method that allows you to insert into the first index.
|
boolean |
addAndMoveToLast(T o)
A customized add method that allows you to insert into the last index.
|
void |
clear() |
void |
clearAndTrim(int size)
Trims the collection down to the requested size and clears all elements while doing so
|
ObjectLinkedOpenCustomHashSet<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.
|
T |
first()
A method to get the first element in the set
|
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.
|
ObjectListIterator<T> |
iterator()
Returns a Type-Specific Iterator to reduce (un)boxing
|
ObjectBidirectionalIterator<T> |
iterator(T fromElement)
A type Specific Iterator starting from a given key
|
T |
last()
A method to get the last element in the set
|
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.
|
boolean |
moveToFirst(T o)
A specific move method to move a given key to the first index.
|
boolean |
moveToLast(T o)
A specific move method to move a given key to the last index.
|
T |
pollFirst()
A method to get and remove the first element in the set
|
T |
pollLast()
A method to get and remove the last element in the set
|
<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
|
add, addAll, addAll, addOrGet, contains, getStrategy, remove, size, trimequals, hashCodecontainsAll, containsAll, containsAny, containsAny, removeAll, removeAll, retainAll, retainAllisEmpty, removeAll, retainAll, toArray, toArray, toStringspliterator, synchronize, synchronize, unmodifiableadd, addAll, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArrayaddAll, addAll, addAll, addAll, containsAll, containsAny, containsAny, pour, removeAll, removeAll, retainAll, retainAll, toArrayarrayflatMap, asAsync, distinct, filter, flatMap, limit, map, peek, pourAsList, pourAsSet, repeat, sortedof, sizeclearAndTrim, trimpublic ObjectLinkedOpenCustomHashSet(ObjectStrategy<? super T> strategy)
strategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic ObjectLinkedOpenCustomHashSet(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 ObjectLinkedOpenCustomHashSet(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 ObjectLinkedOpenCustomHashSet(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 ObjectLinkedOpenCustomHashSet(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 ObjectLinkedOpenCustomHashSet(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 ObjectLinkedOpenCustomHashSet(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 ObjectLinkedOpenCustomHashSet(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 ObjectLinkedOpenCustomHashSet(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 ObjectLinkedOpenCustomHashSet(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 ObjectLinkedOpenCustomHashSet(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 ObjectLinkedOpenCustomHashSet(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 ObjectLinkedOpenCustomHashSet(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 boolean addAndMoveToFirst(T o)
ObjectOrderedSetaddAndMoveToFirst in interface ObjectOrderedSet<T>o - the element that should be insertedSet.add(Object)public boolean addAndMoveToLast(T o)
ObjectOrderedSetaddAndMoveToLast in interface ObjectOrderedSet<T>o - the element that should be insertedSet.add(Object)public boolean moveToFirst(T o)
ObjectOrderedSetmoveToFirst in interface ObjectOrderedSet<T>o - that should be moved to the first indexpublic boolean moveToLast(T o)
ObjectOrderedSetmoveToLast in interface ObjectOrderedSet<T>o - that should be moved to the first lastpublic T first()
ObjectOrderedSetfirst in interface ObjectOrderedSet<T>public T pollFirst()
ObjectOrderedSetpollFirst in interface ObjectOrderedSet<T>public T last()
ObjectOrderedSetlast in interface ObjectOrderedSet<T>public T pollLast()
ObjectOrderedSetpollLast in interface ObjectOrderedSet<T>public void clear()
clear in interface java.util.Collection<T>clear in interface java.util.Set<T>clear in class ObjectOpenCustomHashSet<T>public void clearAndTrim(int size)
ITrimmableclearAndTrim in interface ITrimmableclearAndTrim in class ObjectOpenCustomHashSet<T>size - the amount of elements that should be allowedpublic void forEach(java.util.function.Consumer<? super T> action)
forEach in interface java.lang.Iterable<T>forEach in class ObjectOpenCustomHashSet<T>public void forEachIndexed(IntObjectConsumer<T> action)
ObjectIterableforEachIndexed in interface ObjectIterable<T>forEachIndexed in class ObjectOpenCustomHashSet<T>action - The action to be performed for each elementpublic <E> void forEach(E input,
ObjectObjectConsumer<E,T> action)
ObjectIterableforEach in interface ObjectIterable<T>forEach in class ObjectOpenCustomHashSet<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>matchesAny in class ObjectOpenCustomHashSet<T>filter - that should be appliedpublic boolean matchesNone(java.util.function.Predicate<T> filter)
ObjectIterablematchesNone in interface ObjectIterable<T>matchesNone in class ObjectOpenCustomHashSet<T>filter - that should be appliedpublic boolean matchesAll(java.util.function.Predicate<T> filter)
ObjectIterablematchesAll in interface ObjectIterable<T>matchesAll in class ObjectOpenCustomHashSet<T>filter - that should be appliedpublic <E> E reduce(E identity,
java.util.function.BiFunction<E,T,E> operator)
ObjectIterablereduce in interface ObjectIterable<T>reduce in class ObjectOpenCustomHashSet<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>reduce in class ObjectOpenCustomHashSet<T>operator - the operation that should be appliedpublic T findFirst(java.util.function.Predicate<T> filter)
ObjectIterablefindFirst in interface ObjectIterable<T>findFirst in class ObjectOpenCustomHashSet<T>filter - that should be appliedpublic int count(java.util.function.Predicate<T> filter)
ObjectIterablecount in interface ObjectIterable<T>count in class ObjectOpenCustomHashSet<T>filter - that should be appliedpublic ObjectListIterator<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 ObjectOrderedSet<T>iterator in interface ObjectSet<T>iterator in class ObjectOpenCustomHashSet<T>Collection.iterator()public ObjectBidirectionalIterator<T> iterator(T fromElement)
ObjectOrderedSetiterator in interface ObjectOrderedSet<T>fromElement - the element the iterator should start frompublic ObjectLinkedOpenCustomHashSet<T> copy()
ObjectCollectioncopy in interface ObjectCollection<T>copy in interface ObjectOrderedSet<T>copy in interface ObjectSet<T>copy in class ObjectOpenCustomHashSet<T>