public class ShortArraySet extends AbstractShortSet implements ShortSortedSet
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 |
|---|
ShortArraySet()
Default Constructor
|
ShortArraySet(java.util.Collection<? extends java.lang.Short> c)
Deprecated.
|
ShortArraySet(int capacity)
Minimum Capacity Constructor
|
ShortArraySet(java.util.Set<? extends java.lang.Short> s)
Deprecated.
|
ShortArraySet(short[] array)
Constructur using initial Array
|
ShortArraySet(short[] array,
int length)
Constructur using initial Array
|
ShortArraySet(ShortCollection c)
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
|
ShortArraySet(ShortSet s)
A Helper constructor that fast copies the element out of a set into the ArraySet.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(short o)
A Type-Specific add function to reduce (un)boxing
|
boolean |
addAndMoveToFirst(short o)
A customized add method that allows you to insert into the first index.
|
boolean |
addAndMoveToLast(short o)
A customized add method that allows you to insert into the last index.
|
void |
clear() |
ShortComparator |
comparator()
A Type Specific Comparator method
|
boolean |
contains(short e)
A Type-Specific implementation of contains.
|
short |
firstShort()
A method to get the first element in the set
|
void |
forEach(ShortConsumer action)
A Type Specific foreach function that reduces (un)boxing
|
ShortSortedSet |
headSet(short toElement)
A Type Specific HeadSet method to reduce boxing/unboxing
|
ShortBidirectionalIterator |
iterator()
Returns a Type-Specific Iterator to reduce (un)boxing
|
ShortBidirectionalIterator |
iterator(short fromElement)
A type Specific Iterator starting from a given key
|
short |
lastShort()
A method to get the last element in the set
|
boolean |
moveToFirst(short o)
A specific move method to move a given key to the first index.
|
boolean |
moveToLast(short o)
A specific move method to move a given key to the last index.
|
short |
pollFirstShort()
A method to get and remove the first element in the set
|
short |
pollLastShort()
A method to get and remove the last element in the set
|
boolean |
remIf(java.util.function.IntPredicate filter)
A Type-Specific removeIf function to reduce (un)boxing.
|
boolean |
remove(short o)
A Type Specific remove function to reduce boxing/unboxing
|
boolean |
removeAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
removeAll(ShortCollection c)
A Type-Specific implementation of removeAll.
|
boolean |
retainAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
retainAll(ShortCollection c)
A Type-Specific implementation of retainAll.
|
int |
size() |
ShortSortedSet |
subSet(short fromElement,
short toElement)
A Type Specific SubSet method to reduce boxing/unboxing
|
ShortSortedSet |
tailSet(short fromElement)
A Type Specific TailSet method to reduce boxing/unboxing
|
java.lang.Object[] |
toArray()
Deprecated.
|
<E> E[] |
toArray(E[] a)
Deprecated.
|
short[] |
toShortArray(short[] a)
A Type-Specific implementation of toArray.
|
equals, hashCodeadd, addAll, addAll, contains, containsAll, containsAny, containsAny, remove, remShort, toShortArrayfirst, headSet, last, spliterator, subSet, tailSetadd, contains, remove, remShortaddAll, containsAll, containsAny, containsAny, parallelPrimitiveStream, primitiveStream, removeIf, toShortArrayforEachpublic ShortArraySet()
public ShortArraySet(int capacity)
capacity - the minimum capacity of the internal arrayjava.lang.NegativeArraySizeException - if the capacity is negativepublic ShortArraySet(short[] array)
array - the array that should be used for set.public ShortArraySet(short[] 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 ShortArraySet(java.util.Collection<? extends java.lang.Short> c)
c - the elements that should be added to the set.public ShortArraySet(ShortCollection c)
c - the elements that should be added to the set.@Deprecated public ShortArraySet(java.util.Set<? extends java.lang.Short> s)
s - the set the element should be taken frompublic ShortArraySet(ShortSet s)
s - the set the element should be taken frompublic boolean add(short o)
ShortCollectionadd in interface ShortCollectiono - the element that should be addedpublic boolean addAndMoveToFirst(short o)
ShortSortedSetaddAndMoveToFirst in interface ShortSortedSeto - the element that should be insertedSet.add(Object)public boolean addAndMoveToLast(short o)
ShortSortedSetaddAndMoveToLast in interface ShortSortedSeto - the element that should be insertedSet.add(Object)public boolean moveToFirst(short o)
ShortSortedSetmoveToFirst in interface ShortSortedSeto - that should be moved to the first indexpublic boolean moveToLast(short o)
ShortSortedSetmoveToLast in interface ShortSortedSeto - that should be moved to the first lastpublic boolean contains(short e)
AbstractShortCollectioncontains in interface ShortCollectioncontains in class AbstractShortCollectione - the element that should be searched for.public short firstShort()
ShortSortedSetfirstShort in interface ShortSortedSetpublic short lastShort()
ShortSortedSetlastShort in interface ShortSortedSetpublic boolean removeAll(ShortCollection c)
AbstractShortCollectionremoveAll in interface ShortCollectionremoveAll in class AbstractShortCollectionc - the elements that should be deletedCollection.removeAll(Collection)public boolean retainAll(ShortCollection c)
AbstractShortCollectionretainAll in interface ShortCollectionretainAll in class AbstractShortCollectionc - the elements that should be keptCollection.retainAll(Collection)@Deprecated public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Short>removeAll in interface java.util.Set<java.lang.Short>removeAll in class java.util.AbstractCollection<java.lang.Short>@Deprecated public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Short>retainAll in interface java.util.Set<java.lang.Short>retainAll in class java.util.AbstractCollection<java.lang.Short>public boolean remove(short o)
ShortSetpublic short pollFirstShort()
ShortSortedSetpollFirstShort in interface ShortSortedSetpublic short pollLastShort()
ShortSortedSetpollLastShort in interface ShortSortedSetpublic boolean remIf(java.util.function.IntPredicate filter)
ShortCollectionRemoves elements that were selected by the filter
remIf in interface ShortCollectionfilter - Filters the elements that should be removedCollection.removeIf(Predicate)public void forEach(ShortConsumer action)
ShortIterableforEach in interface ShortIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public ShortBidirectionalIterator iterator()
ShortCollectioniterator in interface java.lang.Iterable<java.lang.Short>iterator in interface java.util.Collection<java.lang.Short>iterator in interface java.util.Set<java.lang.Short>iterator in interface ShortCollectioniterator in interface ShortIterableiterator in interface ShortSetiterator in interface ShortSortedSetiterator in class AbstractShortSetCollection.iterator()public ShortBidirectionalIterator iterator(short fromElement)
ShortSortedSetiterator in interface ShortSortedSetfromElement - the element the iterator should start frompublic ShortSortedSet subSet(short fromElement, short toElement)
ShortSortedSetsubSet in interface ShortSortedSetfromElement - where the SubSet should starttoElement - where the SubSet should endpublic ShortSortedSet headSet(short toElement)
ShortSortedSetheadSet in interface ShortSortedSettoElement - where the HeadSet should endpublic ShortSortedSet tailSet(short fromElement)
ShortSortedSettailSet in interface ShortSortedSetfromElement - where the TailSet should startpublic ShortComparator comparator()
ShortSortedSetcomparator in interface java.util.SortedSet<java.lang.Short>comparator in interface ShortSortedSetpublic void clear()
clear in interface java.util.Collection<java.lang.Short>clear in interface java.util.Set<java.lang.Short>clear in class java.util.AbstractCollection<java.lang.Short>public int size()
size in interface java.util.Collection<java.lang.Short>size in interface java.util.Set<java.lang.Short>size in class java.util.AbstractCollection<java.lang.Short>public short[] toShortArray(short[] a)
AbstractShortCollectiontoShortArray in interface ShortCollectiontoShortArray in class AbstractShortCollectiona - 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.Short>toArray in interface java.util.Set<java.lang.Short>toArray in class java.util.AbstractCollection<java.lang.Short>@Deprecated public <E> E[] toArray(E[] a)
toArray in interface java.util.Collection<java.lang.Short>toArray in interface java.util.Set<java.lang.Short>toArray in class java.util.AbstractCollection<java.lang.Short>