|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glassfish.grizzly.utils.ArraySet<T>
public class ArraySet<T>
The thread safe set implementation, which uses array to hold its elements. This set could be used, for cases, which require minimum set modifications.
Constructor Summary | |
---|---|
ArraySet(Class<T> clazz)
|
|
ArraySet(Class<T> clazz,
boolean replaceElementIfEquals)
|
Method Summary | ||
---|---|---|
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()
|
|
|
toArray(K[] a)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Set |
---|
equals, hashCode |
Constructor Detail |
---|
public ArraySet(Class<T> clazz)
public ArraySet(Class<T> clazz, boolean replaceElementIfEquals)
Method Detail |
---|
public final boolean addAll(T... elements)
elements
- the elements to add.
public boolean addAll(Collection<? extends T> collection)
addAll
in interface Collection<T>
addAll
in interface Set<T>
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()
clear
in interface Collection<T>
clear
in interface Set<T>
public int size()
size
in interface Collection<T>
size
in interface Set<T>
public boolean isEmpty()
isEmpty
in interface Collection<T>
isEmpty
in interface Set<T>
public boolean add(T element)
add
in interface Collection<T>
add
in interface Set<T>
public boolean contains(Object o)
contains
in interface Collection<T>
contains
in interface Set<T>
public Object[] toArray()
toArray
in interface Collection<T>
toArray
in interface Set<T>
public <K> K[] toArray(K[] a)
toArray
in interface Collection<T>
toArray
in interface Set<T>
public boolean remove(Object o)
remove
in interface Collection<T>
remove
in interface Set<T>
public boolean containsAll(Collection<?> collection)
containsAll
in interface Collection<T>
containsAll
in interface Set<T>
public boolean retainAll(Collection<?> collection)
retainAll
in interface Collection<T>
retainAll
in interface Set<T>
public boolean removeAll(Collection<?> collection)
removeAll
in interface Collection<T>
removeAll
in interface Set<T>
public Iterator<T> iterator()
iterator
in interface Iterable<T>
iterator
in interface Collection<T>
iterator
in interface Set<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |