public class FloatArraySet extends AbstractFloatSet implements FloatOrderedSet
List.indexOf(Object) for no duplication.
Unless a array constructor is used the ArraySet does not allow for duplication.
This implementation does not shrink the backing array| Constructor and Description |
|---|
FloatArraySet()
Default Constructor
|
FloatArraySet(java.util.Collection<? extends java.lang.Float> c)
Deprecated.
|
FloatArraySet(float[] array)
Constructur using initial Array
|
FloatArraySet(float[] array,
int length)
Constructur using initial Array
|
FloatArraySet(FloatCollection c)
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
|
FloatArraySet(FloatSet s)
A Helper constructor that fast copies the element out of a set into the ArraySet.
|
FloatArraySet(int capacity)
Minimum Capacity Constructor
|
FloatArraySet(java.util.Set<? extends java.lang.Float> s)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(float o)
A Type-Specific add function to reduce (un)boxing
|
boolean |
addAndMoveToFirst(float o)
A customized add method that allows you to insert into the first index.
|
boolean |
addAndMoveToLast(float o)
A customized add method that allows you to insert into the last index.
|
void |
clear() |
boolean |
contains(float e)
A Type-Specific implementation of contains.
|
FloatArraySet |
copy()
A Function that does a shallow clone of the Collection itself.
|
int |
count(Float2BooleanFunction filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
float |
findFirst(Float2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
float |
firstFloat()
A method to get the first element in the set
|
<E> void |
forEach(E input,
ObjectFloatConsumer<E> action)
Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
|
void |
forEach(FloatConsumer action)
A Type Specific foreach function that reduces (un)boxing
|
FloatBidirectionalIterator |
iterator()
Returns a Type-Specific Iterator to reduce (un)boxing
|
FloatBidirectionalIterator |
iterator(float fromElement)
A type Specific Iterator starting from a given key
|
float |
lastFloat()
A method to get the last element in the set
|
boolean |
matchesAll(Float2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(Float2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(Float2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for no matches.
|
boolean |
moveToFirst(float o)
A specific move method to move a given key to the first index.
|
boolean |
moveToLast(float o)
A specific move method to move a given key to the last index.
|
float |
pollFirstFloat()
A method to get and remove the first element in the set
|
float |
pollLastFloat()
A method to get and remove the last element in the set
|
float |
reduce(float identity,
FloatFloatUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
float |
reduce(FloatFloatUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
boolean |
remIf(java.util.function.DoublePredicate filter)
A Type-Specific removeIf function to reduce (un)boxing.
|
boolean |
remove(float o)
A Type Specific remove function to reduce boxing/unboxing
|
boolean |
removeAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
removeAll(FloatCollection c)
A Type-Specific implementation of removeAll.
|
boolean |
removeAll(FloatCollection c,
FloatConsumer r)
A Type-Specific removeAll function that reduces (un)boxing.
|
boolean |
retainAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
retainAll(FloatCollection c)
A Type-Specific implementation of retainAll.
|
boolean |
retainAll(FloatCollection c,
FloatConsumer r)
A Type-Specific retainAll function that reduces (un)boxing.
|
int |
size() |
java.lang.Object[] |
toArray()
Deprecated.
|
<E> E[] |
toArray(E[] a)
Deprecated.
|
float[] |
toFloatArray(float[] a)
A Type-Specific implementation of toArray.
|
equals, hashCodeadd, addAll, addAll, contains, containsAll, containsAll, containsAny, containsAny, remFloat, remove, toFloatArrayspliterator, synchronize, synchronize, unmodifiableadd, contains, remFloat, removeaddAll, addAll, addAll, addAll, containsAll, containsAny, containsAny, parallelPrimitiveStream, pour, primitiveStream, removeIf, toFloatArrayarrayflatMap, asAsync, distinct, filter, flatMap, forEach, limit, map, peek, pourAsList, pourAsSet, sortedpublic FloatArraySet()
public FloatArraySet(int capacity)
capacity - the minimum capacity of the internal arrayjava.lang.NegativeArraySizeException - if the capacity is negativepublic FloatArraySet(float[] array)
array - the array that should be used for set.public FloatArraySet(float[] array,
int length)
array - the array that should be used for set.length - the amount of elements present within the arrayjava.lang.NegativeArraySizeException - if the length is negative@Deprecated public FloatArraySet(java.util.Collection<? extends java.lang.Float> c)
c - the elements that should be added to the set.public FloatArraySet(FloatCollection c)
c - the elements that should be added to the set.@Deprecated public FloatArraySet(java.util.Set<? extends java.lang.Float> s)
s - the set the element should be taken frompublic FloatArraySet(FloatSet s)
s - the set the element should be taken frompublic boolean add(float o)
FloatCollectionadd in interface FloatCollectiono - the element that should be addedpublic boolean addAndMoveToFirst(float o)
FloatOrderedSetaddAndMoveToFirst in interface FloatOrderedSeto - the element that should be insertedSet.add(Object)public boolean addAndMoveToLast(float o)
FloatOrderedSetaddAndMoveToLast in interface FloatOrderedSeto - the element that should be insertedSet.add(Object)public boolean moveToFirst(float o)
FloatOrderedSetmoveToFirst in interface FloatOrderedSeto - that should be moved to the first indexpublic boolean moveToLast(float o)
FloatOrderedSetmoveToLast in interface FloatOrderedSeto - that should be moved to the first lastpublic boolean contains(float e)
AbstractFloatCollectioncontains in interface FloatCollectioncontains in class AbstractFloatCollectione - the element that should be searched for.public float firstFloat()
FloatOrderedSetfirstFloat in interface FloatOrderedSetpublic float lastFloat()
FloatOrderedSetlastFloat in interface FloatOrderedSetpublic boolean removeAll(FloatCollection c)
AbstractFloatCollectionremoveAll in interface FloatCollectionremoveAll in class AbstractFloatCollectionc - the elements that should be deletedCollection.removeAll(Collection)public boolean removeAll(FloatCollection c, FloatConsumer r)
FloatCollectionremoveAll in interface FloatCollectionremoveAll in class AbstractFloatCollectionc - the collection of elements that should be removedr - elements that got removedCollection.removeAll(Collection)public boolean retainAll(FloatCollection c)
AbstractFloatCollectionretainAll in interface FloatCollectionretainAll in class AbstractFloatCollectionc - the elements that should be keptCollection.retainAll(Collection)public boolean retainAll(FloatCollection c, FloatConsumer r)
FloatCollectionretainAll in interface FloatCollectionretainAll in class AbstractFloatCollectionc - the collection of elements that should be keptr - elements that got removedCollection.retainAll(Collection)@Deprecated public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Float>removeAll in interface java.util.Set<java.lang.Float>removeAll in class java.util.AbstractCollection<java.lang.Float>@Deprecated public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Float>retainAll in interface java.util.Set<java.lang.Float>retainAll in class java.util.AbstractCollection<java.lang.Float>public boolean remove(float o)
FloatSetpublic float pollFirstFloat()
FloatOrderedSetpollFirstFloat in interface FloatOrderedSetpublic float pollLastFloat()
FloatOrderedSetpollLastFloat in interface FloatOrderedSetpublic boolean remIf(java.util.function.DoublePredicate filter)
FloatCollectionRemoves elements that were selected by the filter
remIf in interface FloatCollectionfilter - Filters the elements that should be removedCollection.removeIf(Predicate)public void forEach(FloatConsumer action)
FloatIterableforEach in interface FloatIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public <E> void forEach(E input,
ObjectFloatConsumer<E> action)
FloatIterableforEach in interface FloatIterableE - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementpublic boolean matchesAny(Float2BooleanFunction filter)
FloatIterablematchesAny in interface FloatIterablefilter - that should be appliedpublic boolean matchesNone(Float2BooleanFunction filter)
FloatIterablematchesNone in interface FloatIterablefilter - that should be appliedpublic boolean matchesAll(Float2BooleanFunction filter)
FloatIterablematchesAll in interface FloatIterablefilter - that should be appliedpublic float findFirst(Float2BooleanFunction filter)
FloatIterablefindFirst in interface FloatIterablefilter - that should be appliedpublic float reduce(float identity,
FloatFloatUnaryOperator operator)
FloatIterablereduce in interface FloatIterableidentity - the start valueoperator - the operation that should be appliedpublic float reduce(FloatFloatUnaryOperator operator)
FloatIterablereduce in interface FloatIterableoperator - the operation that should be appliedpublic int count(Float2BooleanFunction filter)
FloatIterablecount in interface FloatIterablefilter - that should be appliedpublic FloatBidirectionalIterator iterator()
FloatCollectioniterator in interface java.lang.Iterable<java.lang.Float>iterator in interface java.util.Collection<java.lang.Float>iterator in interface java.util.Set<java.lang.Float>iterator in interface FloatCollectioniterator in interface FloatIterableiterator in interface FloatOrderedSetiterator in interface FloatSetiterator in class AbstractFloatSetCollection.iterator()public FloatBidirectionalIterator iterator(float fromElement)
FloatOrderedSetiterator in interface FloatOrderedSetfromElement - the element the iterator should start frompublic FloatArraySet copy()
FloatCollectioncopy in interface FloatCollectioncopy in interface FloatOrderedSetcopy in interface FloatSetcopy in class AbstractFloatSetpublic void clear()
clear in interface java.util.Collection<java.lang.Float>clear in interface java.util.Set<java.lang.Float>clear in class java.util.AbstractCollection<java.lang.Float>public int size()
size in interface java.util.Collection<java.lang.Float>size in interface java.util.Set<java.lang.Float>size in class java.util.AbstractCollection<java.lang.Float>public float[] toFloatArray(float[] a)
AbstractFloatCollectiontoFloatArray in interface FloatCollectiontoFloatArray in class AbstractFloatCollectiona - array that the elements should be injected to. If null or to small a new array with the right size is createdCollection.toArray(Object[])@Deprecated public java.lang.Object[] toArray()
toArray in interface java.util.Collection<java.lang.Float>toArray in interface java.util.Set<java.lang.Float>toArray in class java.util.AbstractCollection<java.lang.Float>@Deprecated public <E> E[] toArray(E[] a)
toArray in interface java.util.Collection<java.lang.Float>toArray in interface java.util.Set<java.lang.Float>toArray in class java.util.AbstractCollection<java.lang.Float>