|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<T>
java.util.EnumSet<T>
public class EnumSet<T extends Enum<T>>
| Method Summary | ||
|---|---|---|
boolean |
add(T val)
Add an object to the collection (optional operation). |
|
boolean |
addAll(Collection<? extends T> c)
Add all the elements of a given collection to this collection (optional operation). |
|
static
|
allOf(Class<T> eltType)
|
|
void |
clear()
Remove all elements from the collection (optional operation). |
|
EnumSet<T> |
clone()
clone creates a shallow clone of this. |
|
static
|
complementOf(EnumSet<T> other)
|
|
boolean |
contains(Object o)
Test whether this collection contains a given object. |
|
boolean |
containsAll(Collection<?> c)
Tests whether this collection contains all the elements in a given collection. |
|
static
|
copyOf(Collection<T> other)
|
|
static
|
copyOf(EnumSet<T> other)
|
|
Iterator<T> |
iterator()
Return an Iterator over this collection. |
|
static
|
noneOf(Class<T> eltType)
|
|
static
|
of(T first)
|
|
static
|
of(T first,
T... rest)
|
|
static
|
of(T first,
T second)
|
|
static
|
of(T first,
T second,
T third)
|
|
static
|
of(T first,
T second,
T third,
T fourth)
|
|
static
|
of(T first,
T second,
T third,
T fourth,
T fifth)
|
|
static
|
range(T from,
T to)
|
|
boolean |
remove(Object o)
Remove a single instance of an object from this collection (optional operation). |
|
boolean |
removeAll(Collection<?> c)
Removes from this set all elements in the given collection (optional operation). |
|
boolean |
retainAll(Collection<?> c)
Remove from this collection all its elements that are not contained in a given collection (optional operation). |
|
int |
size()
Return the number of elements in this collection. |
|
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode |
| Methods inherited from class java.util.AbstractCollection |
|---|
isEmpty, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
isEmpty, toArray, toArray |
| Method Detail |
|---|
public EnumSet<T> clone()
Object
clone in class Objectpublic int size()
AbstractCollection
size in interface Collection<T extends Enum<T>>size in interface Set<T extends Enum<T>>size in class AbstractCollection<T extends Enum<T>>public Iterator<T> iterator()
AbstractCollection
iterator in interface Iterable<T extends Enum<T>>iterator in interface Collection<T extends Enum<T>>iterator in interface Set<T extends Enum<T>>iterator in class AbstractCollection<T extends Enum<T>>public boolean add(T val)
AbstractCollection
add in interface Collection<T extends Enum<T>>add in interface Set<T extends Enum<T>>add in class AbstractCollection<T extends Enum<T>>val - the object to add
public boolean addAll(Collection<? extends T> c)
AbstractCollection
addAll in interface Collection<T extends Enum<T>>addAll in interface Set<T extends Enum<T>>addAll in class AbstractCollection<T extends Enum<T>>c - the collection to add the elements of to this collection
AbstractCollection.add(Object)public void clear()
AbstractCollection
clear in interface Collection<T extends Enum<T>>clear in interface Set<T extends Enum<T>>clear in class AbstractCollection<T extends Enum<T>>Iterator.remove()public boolean contains(Object o)
AbstractCollection
contains in interface Collection<T extends Enum<T>>contains in interface Set<T extends Enum<T>>contains in class AbstractCollection<T extends Enum<T>>o - the object to remove from this collection
public boolean containsAll(Collection<?> c)
AbstractCollection
containsAll in interface Collection<T extends Enum<T>>containsAll in interface Set<T extends Enum<T>>containsAll in class AbstractCollection<T extends Enum<T>>c - the collection to test against
AbstractCollection.contains(Object)public boolean remove(Object o)
AbstractCollection(o == null ? e == null : o.equals(e)), if such an element
exists. This implementation obtains an iterator over the collection
and iterates over it, testing each element for equality with the given
object. If it is equal, it is removed by the iterator's remove method
(thus this method will fail with an UnsupportedOperationException if
the Iterator's remove method does). After the first element has been
removed, true is returned; if the end of the collection is reached, false
is returned.
remove in interface Collection<T extends Enum<T>>remove in interface Set<T extends Enum<T>>remove in class AbstractCollection<T extends Enum<T>>o - the object to remove from this collection
Iterator.remove()public boolean removeAll(Collection<?> c)
AbstractSetsize() to determine
the smaller collection. Then, if this set is smaller, it iterates
over the set, calling Iterator.remove if the collection contains
the element. If this set is larger, it iterates over the collection,
calling Set.remove for all elements in the collection. Note that
this operation will fail if a remove methods is not supported.
removeAll in interface Collection<T extends Enum<T>>removeAll in interface Set<T extends Enum<T>>removeAll in class AbstractSet<T extends Enum<T>>c - the collection of elements to remove
AbstractCollection.remove(Object),
Collection.contains(Object),
Iterator.remove()public boolean retainAll(Collection<?> c)
AbstractCollection
retainAll in interface Collection<T extends Enum<T>>retainAll in interface Set<T extends Enum<T>>retainAll in class AbstractCollection<T extends Enum<T>>c - the collection to retain the elements of
Iterator.remove()public static <T extends Enum<T>> EnumSet<T> allOf(Class<T> eltType)
public static <T extends Enum<T>> EnumSet<T> noneOf(Class<T> eltType)
public static <T extends Enum<T>> EnumSet<T> copyOf(EnumSet<T> other)
public static <T extends Enum<T>> EnumSet<T> copyOf(Collection<T> other)
public static <T extends Enum<T>> EnumSet<T> complementOf(EnumSet<T> other)
public static <T extends Enum<T>> EnumSet<T> of(T first)
public static <T extends Enum<T>> EnumSet<T> of(T first,
T second)
public static <T extends Enum<T>> EnumSet<T> of(T first,
T second,
T third)
public static <T extends Enum<T>> EnumSet<T> of(T first,
T second,
T third,
T fourth)
public static <T extends Enum<T>> EnumSet<T> of(T first,
T second,
T third,
T fourth,
T fifth)
public static <T extends Enum<T>> EnumSet<T> of(T first,
T... rest)
public static <T extends Enum<T>> EnumSet<T> range(T from,
T to)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||