public class DoubleArraySet extends AbstractDoubleSet implements DoubleSortedSet
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 |
|---|
DoubleArraySet()
Default Constructor
|
DoubleArraySet(java.util.Collection<? extends java.lang.Double> c)
Deprecated.
|
DoubleArraySet(double[] array)
Constructur using initial Array
|
DoubleArraySet(double[] array,
int length)
Constructur using initial Array
|
DoubleArraySet(DoubleCollection c)
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
|
DoubleArraySet(DoubleSet s)
A Helper constructor that fast copies the element out of a set into the ArraySet.
|
DoubleArraySet(int capacity)
Minimum Capacity Constructor
|
DoubleArraySet(java.util.Set<? extends java.lang.Double> s)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(double o)
A Type-Specific add function to reduce (un)boxing
|
boolean |
addAndMoveToFirst(double o)
A customized add method that allows you to insert into the first index.
|
boolean |
addAndMoveToLast(double o)
A customized add method that allows you to insert into the last index.
|
void |
clear() |
DoubleComparator |
comparator()
A Type Specific Comparator method
|
boolean |
contains(double e)
A Type-Specific implementation of contains.
|
double |
firstDouble()
A method to get the first element in the set
|
void |
forEach(DoubleConsumer action)
A Type Specific foreach function that reduces (un)boxing
|
DoubleSortedSet |
headSet(double toElement)
A Type Specific HeadSet method to reduce boxing/unboxing
|
DoubleBidirectionalIterator |
iterator()
Returns a Type-Specific Iterator to reduce (un)boxing
|
DoubleBidirectionalIterator |
iterator(double fromElement)
A type Specific Iterator starting from a given key
|
double |
lastDouble()
A method to get the last element in the set
|
boolean |
moveToFirst(double o)
A specific move method to move a given key to the first index.
|
boolean |
moveToLast(double o)
A specific move method to move a given key to the last index.
|
double |
pollFirstDouble()
A method to get and remove the first element in the set
|
double |
pollLastDouble()
A method to get and remove the last element in the set
|
boolean |
remIf(java.util.function.DoublePredicate filter)
A Type-Specific removeIf function to reduce (un)boxing.
|
boolean |
remove(double o)
A Type Specific remove function to reduce boxing/unboxing
|
boolean |
removeAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
removeAll(DoubleCollection c)
A Type-Specific implementation of removeAll.
|
boolean |
retainAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
retainAll(DoubleCollection c)
A Type-Specific implementation of retainAll.
|
int |
size() |
DoubleSortedSet |
subSet(double fromElement,
double toElement)
A Type Specific SubSet method to reduce boxing/unboxing
|
DoubleSortedSet |
tailSet(double fromElement)
A Type Specific TailSet method to reduce boxing/unboxing
|
java.lang.Object[] |
toArray()
Deprecated.
|
<E> E[] |
toArray(E[] a)
Deprecated.
|
double[] |
toDoubleArray(double[] a)
A Type-Specific implementation of toArray.
|
equals, hashCodeadd, addAll, addAll, contains, containsAll, containsAny, containsAny, remDouble, remove, toDoubleArrayfirst, headSet, last, spliterator, subSet, tailSetadd, contains, remDouble, removeaddAll, containsAll, containsAny, containsAny, parallelPrimitiveStream, primitiveStream, removeIf, toDoubleArrayforEachpublic DoubleArraySet()
public DoubleArraySet(int capacity)
capacity - the minimum capacity of the internal arrayjava.lang.NegativeArraySizeException - if the capacity is negativepublic DoubleArraySet(double[] array)
array - the array that should be used for set.public DoubleArraySet(double[] 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 DoubleArraySet(java.util.Collection<? extends java.lang.Double> c)
c - the elements that should be added to the set.public DoubleArraySet(DoubleCollection c)
c - the elements that should be added to the set.@Deprecated public DoubleArraySet(java.util.Set<? extends java.lang.Double> s)
s - the set the element should be taken frompublic DoubleArraySet(DoubleSet s)
s - the set the element should be taken frompublic boolean add(double o)
DoubleCollectionadd in interface DoubleCollectiono - the element that should be addedpublic boolean addAndMoveToFirst(double o)
DoubleSortedSetaddAndMoveToFirst in interface DoubleSortedSeto - the element that should be insertedSet.add(Object)public boolean addAndMoveToLast(double o)
DoubleSortedSetaddAndMoveToLast in interface DoubleSortedSeto - the element that should be insertedSet.add(Object)public boolean moveToFirst(double o)
DoubleSortedSetmoveToFirst in interface DoubleSortedSeto - that should be moved to the first indexpublic boolean moveToLast(double o)
DoubleSortedSetmoveToLast in interface DoubleSortedSeto - that should be moved to the first lastpublic boolean contains(double e)
AbstractDoubleCollectioncontains in interface DoubleCollectioncontains in class AbstractDoubleCollectione - the element that should be searched for.public double firstDouble()
DoubleSortedSetfirstDouble in interface DoubleSortedSetpublic double lastDouble()
DoubleSortedSetlastDouble in interface DoubleSortedSetpublic boolean removeAll(DoubleCollection c)
AbstractDoubleCollectionremoveAll in interface DoubleCollectionremoveAll in class AbstractDoubleCollectionc - the elements that should be deletedCollection.removeAll(Collection)public boolean retainAll(DoubleCollection c)
AbstractDoubleCollectionretainAll in interface DoubleCollectionretainAll in class AbstractDoubleCollectionc - the elements that should be keptCollection.retainAll(Collection)@Deprecated public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Double>removeAll in interface java.util.Set<java.lang.Double>removeAll in class java.util.AbstractCollection<java.lang.Double>@Deprecated public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Double>retainAll in interface java.util.Set<java.lang.Double>retainAll in class java.util.AbstractCollection<java.lang.Double>public boolean remove(double o)
DoubleSetpublic double pollFirstDouble()
DoubleSortedSetpollFirstDouble in interface DoubleSortedSetpublic double pollLastDouble()
DoubleSortedSetpollLastDouble in interface DoubleSortedSetpublic boolean remIf(java.util.function.DoublePredicate filter)
DoubleCollectionRemoves elements that were selected by the filter
remIf in interface DoubleCollectionfilter - Filters the elements that should be removedCollection.removeIf(Predicate)public void forEach(DoubleConsumer action)
DoubleIterableforEach in interface DoubleIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public DoubleBidirectionalIterator iterator()
DoubleCollectioniterator in interface java.lang.Iterable<java.lang.Double>iterator in interface java.util.Collection<java.lang.Double>iterator in interface java.util.Set<java.lang.Double>iterator in interface DoubleCollectioniterator in interface DoubleIterableiterator in interface DoubleSetiterator in interface DoubleSortedSetiterator in class AbstractDoubleSetCollection.iterator()public DoubleBidirectionalIterator iterator(double fromElement)
DoubleSortedSetiterator in interface DoubleSortedSetfromElement - the element the iterator should start frompublic DoubleSortedSet subSet(double fromElement, double toElement)
DoubleSortedSetsubSet in interface DoubleSortedSetfromElement - where the SubSet should starttoElement - where the SubSet should endpublic DoubleSortedSet headSet(double toElement)
DoubleSortedSetheadSet in interface DoubleSortedSettoElement - where the HeadSet should endpublic DoubleSortedSet tailSet(double fromElement)
DoubleSortedSettailSet in interface DoubleSortedSetfromElement - where the TailSet should startpublic DoubleComparator comparator()
DoubleSortedSetcomparator in interface java.util.SortedSet<java.lang.Double>comparator in interface DoubleSortedSetpublic void clear()
clear in interface java.util.Collection<java.lang.Double>clear in interface java.util.Set<java.lang.Double>clear in class java.util.AbstractCollection<java.lang.Double>public int size()
size in interface java.util.Collection<java.lang.Double>size in interface java.util.Set<java.lang.Double>size in class java.util.AbstractCollection<java.lang.Double>public double[] toDoubleArray(double[] a)
AbstractDoubleCollectiontoDoubleArray in interface DoubleCollectiontoDoubleArray in class AbstractDoubleCollectiona - 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.Double>toArray in interface java.util.Set<java.lang.Double>toArray in class java.util.AbstractCollection<java.lang.Double>@Deprecated public <E> E[] toArray(E[] a)
toArray in interface java.util.Collection<java.lang.Double>toArray in interface java.util.Set<java.lang.Double>toArray in class java.util.AbstractCollection<java.lang.Double>