public class LongArraySet extends AbstractLongSet implements LongSortedSet
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 |
|---|
LongArraySet()
Default Constructor
|
LongArraySet(java.util.Collection<? extends java.lang.Long> c)
Deprecated.
|
LongArraySet(int capacity)
Minimum Capacity Constructor
|
LongArraySet(long[] array)
Constructur using initial Array
|
LongArraySet(long[] array,
int length)
Constructur using initial Array
|
LongArraySet(LongCollection c)
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
|
LongArraySet(LongSet s)
A Helper constructor that fast copies the element out of a set into the ArraySet.
|
LongArraySet(java.util.Set<? extends java.lang.Long> s)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(long o)
A Type-Specific add function to reduce (un)boxing
|
boolean |
addAndMoveToFirst(long o)
A customized add method that allows you to insert into the first index.
|
boolean |
addAndMoveToLast(long o)
A customized add method that allows you to insert into the last index.
|
void |
clear() |
LongComparator |
comparator()
A Type Specific Comparator method
|
boolean |
contains(long e)
A Type-Specific implementation of contains.
|
long |
firstLong()
A method to get the first element in the set
|
void |
forEach(LongConsumer action)
A Type Specific foreach function that reduces (un)boxing
|
LongSortedSet |
headSet(long toElement)
A Type Specific HeadSet method to reduce boxing/unboxing
|
LongBidirectionalIterator |
iterator()
Returns a Type-Specific Iterator to reduce (un)boxing
|
LongBidirectionalIterator |
iterator(long fromElement)
A type Specific Iterator starting from a given key
|
long |
lastLong()
A method to get the last element in the set
|
boolean |
moveToFirst(long o)
A specific move method to move a given key to the first index.
|
boolean |
moveToLast(long o)
A specific move method to move a given key to the last index.
|
long |
pollFirstLong()
A method to get and remove the first element in the set
|
long |
pollLastLong()
A method to get and remove the last element in the set
|
boolean |
remIf(java.util.function.LongPredicate filter)
A Type-Specific removeIf function to reduce (un)boxing.
|
boolean |
remove(long o)
A Type Specific remove function to reduce boxing/unboxing
|
boolean |
removeAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
removeAll(LongCollection c)
A Type-Specific implementation of removeAll.
|
boolean |
retainAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
retainAll(LongCollection c)
A Type-Specific implementation of retainAll.
|
int |
size() |
LongSortedSet |
subSet(long fromElement,
long toElement)
A Type Specific SubSet method to reduce boxing/unboxing
|
LongSortedSet |
tailSet(long fromElement)
A Type Specific TailSet method to reduce boxing/unboxing
|
java.lang.Object[] |
toArray()
Deprecated.
|
<E> E[] |
toArray(E[] a)
Deprecated.
|
long[] |
toLongArray(long[] a)
A Type-Specific implementation of toArray.
|
equals, hashCodeadd, addAll, addAll, contains, containsAll, containsAny, containsAny, remLong, remove, toLongArrayfirst, headSet, last, spliterator, subSet, tailSetadd, contains, remLong, removeaddAll, containsAll, containsAny, containsAny, parallelPrimitiveStream, primitiveStream, removeIf, toLongArrayforEachpublic LongArraySet()
public LongArraySet(int capacity)
capacity - the minimum capacity of the internal arrayjava.lang.NegativeArraySizeException - if the capacity is negativepublic LongArraySet(long[] array)
array - the array that should be used for set.public LongArraySet(long[] 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 LongArraySet(java.util.Collection<? extends java.lang.Long> c)
c - the elements that should be added to the set.public LongArraySet(LongCollection c)
c - the elements that should be added to the set.@Deprecated public LongArraySet(java.util.Set<? extends java.lang.Long> s)
s - the set the element should be taken frompublic LongArraySet(LongSet s)
s - the set the element should be taken frompublic boolean add(long o)
LongCollectionadd in interface LongCollectiono - the element that should be addedpublic boolean addAndMoveToFirst(long o)
LongSortedSetaddAndMoveToFirst in interface LongSortedSeto - the element that should be insertedSet.add(Object)public boolean addAndMoveToLast(long o)
LongSortedSetaddAndMoveToLast in interface LongSortedSeto - the element that should be insertedSet.add(Object)public boolean moveToFirst(long o)
LongSortedSetmoveToFirst in interface LongSortedSeto - that should be moved to the first indexpublic boolean moveToLast(long o)
LongSortedSetmoveToLast in interface LongSortedSeto - that should be moved to the first lastpublic boolean contains(long e)
AbstractLongCollectioncontains in interface LongCollectioncontains in class AbstractLongCollectione - the element that should be searched for.public long firstLong()
LongSortedSetfirstLong in interface LongSortedSetpublic long lastLong()
LongSortedSetlastLong in interface LongSortedSetpublic boolean removeAll(LongCollection c)
AbstractLongCollectionremoveAll in interface LongCollectionremoveAll in class AbstractLongCollectionc - the elements that should be deletedCollection.removeAll(Collection)public boolean retainAll(LongCollection c)
AbstractLongCollectionretainAll in interface LongCollectionretainAll in class AbstractLongCollectionc - the elements that should be keptCollection.retainAll(Collection)@Deprecated public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Long>removeAll in interface java.util.Set<java.lang.Long>removeAll in class java.util.AbstractCollection<java.lang.Long>@Deprecated public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Long>retainAll in interface java.util.Set<java.lang.Long>retainAll in class java.util.AbstractCollection<java.lang.Long>public boolean remove(long o)
LongSetpublic long pollFirstLong()
LongSortedSetpollFirstLong in interface LongSortedSetpublic long pollLastLong()
LongSortedSetpollLastLong in interface LongSortedSetpublic boolean remIf(java.util.function.LongPredicate filter)
LongCollectionRemoves elements that were selected by the filter
remIf in interface LongCollectionfilter - Filters the elements that should be removedCollection.removeIf(Predicate)public void forEach(LongConsumer action)
LongIterableforEach in interface LongIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public LongBidirectionalIterator iterator()
LongCollectioniterator in interface java.lang.Iterable<java.lang.Long>iterator in interface java.util.Collection<java.lang.Long>iterator in interface java.util.Set<java.lang.Long>iterator in interface LongCollectioniterator in interface LongIterableiterator in interface LongSetiterator in interface LongSortedSetiterator in class AbstractLongSetCollection.iterator()public LongBidirectionalIterator iterator(long fromElement)
LongSortedSetiterator in interface LongSortedSetfromElement - the element the iterator should start frompublic LongSortedSet subSet(long fromElement, long toElement)
LongSortedSetsubSet in interface LongSortedSetfromElement - where the SubSet should starttoElement - where the SubSet should endpublic LongSortedSet headSet(long toElement)
LongSortedSetheadSet in interface LongSortedSettoElement - where the HeadSet should endpublic LongSortedSet tailSet(long fromElement)
LongSortedSettailSet in interface LongSortedSetfromElement - where the TailSet should startpublic LongComparator comparator()
LongSortedSetcomparator in interface java.util.SortedSet<java.lang.Long>comparator in interface LongSortedSetpublic void clear()
clear in interface java.util.Collection<java.lang.Long>clear in interface java.util.Set<java.lang.Long>clear in class java.util.AbstractCollection<java.lang.Long>public int size()
size in interface java.util.Collection<java.lang.Long>size in interface java.util.Set<java.lang.Long>size in class java.util.AbstractCollection<java.lang.Long>public long[] toLongArray(long[] a)
AbstractLongCollectiontoLongArray in interface LongCollectiontoLongArray in class AbstractLongCollectiona - 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.Long>toArray in interface java.util.Set<java.lang.Long>toArray in class java.util.AbstractCollection<java.lang.Long>@Deprecated public <E> E[] toArray(E[] a)
toArray in interface java.util.Collection<java.lang.Long>toArray in interface java.util.Set<java.lang.Long>toArray in class java.util.AbstractCollection<java.lang.Long>