T - the type of elements maintained by this Collectionpublic class ObjectArraySet<T> extends AbstractObjectSet<T> implements ObjectSortedSet<T>
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 |
|---|
ObjectArraySet()
Default Constructor
|
ObjectArraySet(java.util.Collection<? extends T> c)
Deprecated.
|
ObjectArraySet(int capacity)
Minimum Capacity Constructor
|
ObjectArraySet(ObjectCollection<T> c)
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
|
ObjectArraySet(ObjectSet<T> s)
A Helper constructor that fast copies the element out of a set into the ArraySet.
|
ObjectArraySet(java.util.Set<? extends T> s)
Deprecated.
|
ObjectArraySet(T[] array)
Constructur using initial Array
|
ObjectArraySet(T[] array,
int length)
Constructur using initial Array
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T o) |
boolean |
addAndMoveToFirst(T o)
A customized add method that allows you to insert into the first index.
|
boolean |
addAndMoveToLast(T o)
A customized add method that allows you to insert into the last index.
|
void |
clear() |
java.util.Comparator<T> |
comparator()
A Type Specific Comparator method
|
boolean |
contains(java.lang.Object e) |
T |
first() |
void |
forEach(java.util.function.Consumer<? super T> action) |
ObjectSortedSet<T> |
headSet(T toElement) |
ObjectBidirectionalIterator<T> |
iterator()
Returns a Type-Specific Iterator to reduce (un)boxing
|
ObjectBidirectionalIterator<T> |
iterator(T fromElement)
A type Specific Iterator starting from a given key
|
T |
last() |
boolean |
moveToFirst(T o)
A specific move method to move a given key to the first index.
|
boolean |
moveToLast(T o)
A specific move method to move a given key to the last index.
|
T |
pollFirst()
A method to get and remove the first element in the set
|
T |
pollLast()
A method to get and remove the last element in the set
|
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
removeAll(ObjectCollection<T> c)
A Type-Specific implementation of removeAll.
|
boolean |
retainAll(java.util.Collection<?> c) |
boolean |
retainAll(ObjectCollection<T> c)
A Type-Specific implementation of retainAll.
|
int |
size() |
ObjectSortedSet<T> |
subSet(T fromElement,
T toElement) |
ObjectSortedSet<T> |
tailSet(T fromElement) |
java.lang.Object[] |
toArray()
Deprecated.
|
<E> E[] |
toArray(E[] a) |
equals, hashCodeaddAll, addAll, containsAll, containsAny, containsAnyspliteratoraddAll, containsAll, containsAny, containsAnypublic ObjectArraySet()
public ObjectArraySet(int capacity)
capacity - the minimum capacity of the internal arrayjava.lang.NegativeArraySizeException - if the capacity is negativepublic ObjectArraySet(T[] array)
array - the array that should be used for set.public ObjectArraySet(T[] 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 ObjectArraySet(java.util.Collection<? extends T> c)
c - the elements that should be added to the set.public ObjectArraySet(ObjectCollection<T> c)
c - the elements that should be added to the set.@Deprecated public ObjectArraySet(java.util.Set<? extends T> s)
s - the set the element should be taken frompublic boolean add(T o)
public boolean addAndMoveToFirst(T o)
ObjectSortedSetaddAndMoveToFirst in interface ObjectSortedSet<T>o - the element that should be insertedSet.add(Object)public boolean addAndMoveToLast(T o)
ObjectSortedSetaddAndMoveToLast in interface ObjectSortedSet<T>o - the element that should be insertedSet.add(Object)public boolean moveToFirst(T o)
ObjectSortedSetmoveToFirst in interface ObjectSortedSet<T>o - that should be moved to the first indexpublic boolean moveToLast(T o)
ObjectSortedSetmoveToLast in interface ObjectSortedSet<T>o - that should be moved to the first lastpublic boolean contains(java.lang.Object e)
public boolean removeAll(ObjectCollection<T> c)
AbstractObjectCollectionremoveAll in interface ObjectCollection<T>removeAll in class AbstractObjectCollection<T>c - the elements that should be deletedCollection.removeAll(Collection)public boolean retainAll(ObjectCollection<T> c)
AbstractObjectCollectionretainAll in interface ObjectCollection<T>retainAll in class AbstractObjectCollection<T>c - the elements that should be keptCollection.retainAll(Collection)public boolean removeAll(java.util.Collection<?> c)
public boolean retainAll(java.util.Collection<?> c)
public boolean remove(java.lang.Object o)
public T pollFirst()
ObjectSortedSetpollFirst in interface ObjectSortedSet<T>public T pollLast()
ObjectSortedSetpollLast in interface ObjectSortedSet<T>public void forEach(java.util.function.Consumer<? super T> action)
forEach in interface java.lang.Iterable<T>public ObjectBidirectionalIterator<T> iterator()
ObjectCollectioniterator in interface java.lang.Iterable<T>iterator in interface java.util.Collection<T>iterator in interface java.util.Set<T>iterator in interface ObjectCollection<T>iterator in interface ObjectIterable<T>iterator in interface ObjectSet<T>iterator in interface ObjectSortedSet<T>iterator in class AbstractObjectSet<T>Collection.iterator()public ObjectBidirectionalIterator<T> iterator(T fromElement)
ObjectSortedSetiterator in interface ObjectSortedSet<T>fromElement - the element the iterator should start frompublic ObjectSortedSet<T> subSet(T fromElement, T toElement)
subSet in interface java.util.SortedSet<T>subSet in interface ObjectSortedSet<T>public ObjectSortedSet<T> headSet(T toElement)
headSet in interface java.util.SortedSet<T>headSet in interface ObjectSortedSet<T>public ObjectSortedSet<T> tailSet(T fromElement)
tailSet in interface java.util.SortedSet<T>tailSet in interface ObjectSortedSet<T>public java.util.Comparator<T> comparator()
ObjectSortedSetcomparator in interface java.util.SortedSet<T>comparator in interface ObjectSortedSet<T>public void clear()
public int size()
@Deprecated public java.lang.Object[] toArray()