public class IntArraySet extends AbstractIntSet implements IntSortedSet
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 |
|---|
IntArraySet()
Default Constructor
|
IntArraySet(java.util.Collection<? extends java.lang.Integer> c)
Deprecated.
|
IntArraySet(int capacity)
Minimum Capacity Constructor
|
IntArraySet(int[] array)
Constructur using initial Array
|
IntArraySet(int[] array,
int length)
Constructur using initial Array
|
IntArraySet(IntCollection c)
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
|
IntArraySet(IntSet s)
A Helper constructor that fast copies the element out of a set into the ArraySet.
|
IntArraySet(java.util.Set<? extends java.lang.Integer> s)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(int o)
A Type-Specific add function to reduce (un)boxing
|
boolean |
addAndMoveToFirst(int o)
A customized add method that allows you to insert into the first index.
|
boolean |
addAndMoveToLast(int o)
A customized add method that allows you to insert into the last index.
|
void |
clear() |
IntComparator |
comparator()
A Type Specific Comparator method
|
boolean |
contains(int e)
A Type-Specific implementation of contains.
|
int |
firstInt()
A method to get the first element in the set
|
void |
forEach(IntConsumer action)
A Type Specific foreach function that reduces (un)boxing
|
IntSortedSet |
headSet(int toElement)
A Type Specific HeadSet method to reduce boxing/unboxing
|
IntBidirectionalIterator |
iterator()
Returns a Type-Specific Iterator to reduce (un)boxing
|
IntBidirectionalIterator |
iterator(int fromElement)
A type Specific Iterator starting from a given key
|
int |
lastInt()
A method to get the last element in the set
|
boolean |
moveToFirst(int o)
A specific move method to move a given key to the first index.
|
boolean |
moveToLast(int o)
A specific move method to move a given key to the last index.
|
int |
pollFirstInt()
A method to get and remove the first element in the set
|
int |
pollLastInt()
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(int o)
A Type Specific remove function to reduce boxing/unboxing
|
boolean |
removeAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
removeAll(IntCollection c)
A Type-Specific implementation of removeAll.
|
boolean |
retainAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
retainAll(IntCollection c)
A Type-Specific implementation of retainAll.
|
int |
size() |
IntSortedSet |
subSet(int fromElement,
int toElement)
A Type Specific SubSet method to reduce boxing/unboxing
|
IntSortedSet |
tailSet(int fromElement)
A Type Specific TailSet method to reduce boxing/unboxing
|
java.lang.Object[] |
toArray()
Deprecated.
|
<E> E[] |
toArray(E[] a)
Deprecated.
|
int[] |
toIntArray(int[] a)
A Type-Specific implementation of toArray.
|
equals, hashCodeadd, addAll, addAll, contains, containsAll, containsAny, containsAny, remInt, remove, toIntArrayfirst, headSet, last, spliterator, subSet, tailSetadd, contains, remInt, removeaddAll, containsAll, containsAny, containsAny, parallelPrimitiveStream, primitiveStream, removeIf, toIntArrayforEachpublic IntArraySet()
public IntArraySet(int capacity)
capacity - the minimum capacity of the internal arrayjava.lang.NegativeArraySizeException - if the capacity is negativepublic IntArraySet(int[] array)
array - the array that should be used for set.public IntArraySet(int[] 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 IntArraySet(java.util.Collection<? extends java.lang.Integer> c)
c - the elements that should be added to the set.public IntArraySet(IntCollection c)
c - the elements that should be added to the set.@Deprecated public IntArraySet(java.util.Set<? extends java.lang.Integer> s)
s - the set the element should be taken frompublic IntArraySet(IntSet s)
s - the set the element should be taken frompublic boolean add(int o)
IntCollectionadd in interface IntCollectiono - the element that should be addedpublic boolean addAndMoveToFirst(int o)
IntSortedSetaddAndMoveToFirst in interface IntSortedSeto - the element that should be insertedSet.add(Object)public boolean addAndMoveToLast(int o)
IntSortedSetaddAndMoveToLast in interface IntSortedSeto - the element that should be insertedSet.add(Object)public boolean moveToFirst(int o)
IntSortedSetmoveToFirst in interface IntSortedSeto - that should be moved to the first indexpublic boolean moveToLast(int o)
IntSortedSetmoveToLast in interface IntSortedSeto - that should be moved to the first lastpublic boolean contains(int e)
AbstractIntCollectioncontains in interface IntCollectioncontains in class AbstractIntCollectione - the element that should be searched for.public int firstInt()
IntSortedSetfirstInt in interface IntSortedSetpublic int lastInt()
IntSortedSetlastInt in interface IntSortedSetpublic boolean removeAll(IntCollection c)
AbstractIntCollectionremoveAll in interface IntCollectionremoveAll in class AbstractIntCollectionc - the elements that should be deletedCollection.removeAll(Collection)public boolean retainAll(IntCollection c)
AbstractIntCollectionretainAll in interface IntCollectionretainAll in class AbstractIntCollectionc - the elements that should be keptCollection.retainAll(Collection)@Deprecated public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Integer>removeAll in interface java.util.Set<java.lang.Integer>removeAll in class java.util.AbstractCollection<java.lang.Integer>@Deprecated public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Integer>retainAll in interface java.util.Set<java.lang.Integer>retainAll in class java.util.AbstractCollection<java.lang.Integer>public boolean remove(int o)
IntSetpublic int pollFirstInt()
IntSortedSetpollFirstInt in interface IntSortedSetpublic int pollLastInt()
IntSortedSetpollLastInt in interface IntSortedSetpublic boolean remIf(java.util.function.IntPredicate filter)
IntCollectionRemoves elements that were selected by the filter
remIf in interface IntCollectionfilter - Filters the elements that should be removedCollection.removeIf(Predicate)public void forEach(IntConsumer action)
IntIterableforEach in interface IntIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public IntBidirectionalIterator iterator()
IntCollectioniterator in interface java.lang.Iterable<java.lang.Integer>iterator in interface java.util.Collection<java.lang.Integer>iterator in interface java.util.Set<java.lang.Integer>iterator in interface IntCollectioniterator in interface IntIterableiterator in interface IntSetiterator in interface IntSortedSetiterator in class AbstractIntSetCollection.iterator()public IntBidirectionalIterator iterator(int fromElement)
IntSortedSetiterator in interface IntSortedSetfromElement - the element the iterator should start frompublic IntSortedSet subSet(int fromElement, int toElement)
IntSortedSetsubSet in interface IntSortedSetfromElement - where the SubSet should starttoElement - where the SubSet should endpublic IntSortedSet headSet(int toElement)
IntSortedSetheadSet in interface IntSortedSettoElement - where the HeadSet should endpublic IntSortedSet tailSet(int fromElement)
IntSortedSettailSet in interface IntSortedSetfromElement - where the TailSet should startpublic IntComparator comparator()
IntSortedSetcomparator in interface java.util.SortedSet<java.lang.Integer>comparator in interface IntSortedSetpublic void clear()
clear in interface java.util.Collection<java.lang.Integer>clear in interface java.util.Set<java.lang.Integer>clear in class java.util.AbstractCollection<java.lang.Integer>public int size()
size in interface java.util.Collection<java.lang.Integer>size in interface java.util.Set<java.lang.Integer>size in class java.util.AbstractCollection<java.lang.Integer>public int[] toIntArray(int[] a)
AbstractIntCollectiontoIntArray in interface IntCollectiontoIntArray in class AbstractIntCollectiona - 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.Integer>toArray in interface java.util.Set<java.lang.Integer>toArray in class java.util.AbstractCollection<java.lang.Integer>@Deprecated public <E> E[] toArray(E[] a)
toArray in interface java.util.Collection<java.lang.Integer>toArray in interface java.util.Set<java.lang.Integer>toArray in class java.util.AbstractCollection<java.lang.Integer>