public class ArraySet<T> extends Object implements Set<T>
Constructor and Description |
---|
ArraySet(Class<T> clazz) |
ArraySet(Class<T> clazz,
boolean replaceElementIfEquals) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(ArraySet<T> source)
Add all the elements from the source ArraySet.
|
boolean |
add(T element) |
boolean |
addAll(Collection<? extends T> collection) |
boolean |
addAll(T... elements)
Add the element(s) to the set.
|
void |
clear()
Remove all the set elements.
|
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> collection) |
T[] |
getArray()
Get the underlying array.
|
T[] |
getArrayCopy()
Get the copy of the underlying array.
|
boolean |
isEmpty() |
Iterator<T> |
iterator() |
T[] |
obtainArrayCopy()
Get the copy of the underlying array.
|
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> collection) |
boolean |
removeAll(Object... elements)
Remove element(s) from the set.
|
boolean |
retainAll(Collection<?> collection) |
int |
size() |
Object[] |
toArray() |
<K> K[] |
toArray(K[] a) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, spliterator
parallelStream, removeIf, stream
public final boolean addAll(T... elements)
elements
- the elements to add.public boolean addAll(Collection<? extends T> collection)
public final boolean add(ArraySet<T> source)
source
- the elements to add.public final boolean removeAll(Object... elements)
elements
- the element(s) to remove.public final T[] getArray()
add(Object)
and remove(Object)
instead.public final T[] getArrayCopy()
public final T[] obtainArrayCopy()
public void clear()
public int size()
public boolean isEmpty()
public boolean add(T element)
public boolean contains(Object o)
public Object[] toArray()
public <K> K[] toArray(K[] a)
public boolean remove(Object o)
public boolean containsAll(Collection<?> collection)
containsAll
in interface Collection<T>
containsAll
in interface Set<T>
public boolean retainAll(Collection<?> collection)
public boolean removeAll(Collection<?> collection)
Copyright © 2015 Oracle Corporation. All rights reserved.