|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.collections.EnumSet<E>
public class EnumSet<E extends Enum<E>>
Implementation of the Set
interface that is backed by an array of
enum values.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Set |
---|
Set.SetListenerList<E> |
Constructor Summary | |
---|---|
EnumSet(Class<E> enumClass)
|
Method Summary | |
---|---|
boolean |
add(E element)
Adds an element to the group. |
void |
clear()
Removes all elements from the collection. |
boolean |
contains(E element)
Tests the existence of an element in the group. |
Comparator<E> |
getComparator()
Returns the collection's sort order. |
int |
getCount()
Returns the number of elements in the set. |
Class<E> |
getEnumClass()
|
ListenerList<SetListener<E>> |
getSetListeners()
Returns the set listener collection. |
boolean |
isEmpty()
Tests the emptiness of the collection. |
Iterator<E> |
iterator()
|
boolean |
remove(E element)
Removes an element from the group. |
void |
setComparator(Comparator<E> comparator)
Sets the collection's sort order, re-ordering the collection's contents and ensuring that new entries preserve the sort order. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EnumSet(Class<E> enumClass)
Method Detail |
---|
public Class<E> getEnumClass()
public boolean add(E element)
Group
add
in interface Group<E extends Enum<E>>
add
in interface Set<E extends Enum<E>>
element
- The element to add to the group.
SetListener.elementAdded(Set, Object)
public boolean remove(E element)
Group
remove
in interface Group<E extends Enum<E>>
remove
in interface Set<E extends Enum<E>>
element
- The element to remove from the set.
SetListener.elementRemoved(Set, Object)
public void clear()
Collection
clear
in interface Collection<E extends Enum<E>>
clear
in interface Set<E extends Enum<E>>
SetListener.setCleared(Set)
public boolean contains(E element)
Group
contains
in interface Group<E extends Enum<E>>
element
- The element whose presence in the group is to be tested.
public boolean isEmpty()
Collection
isEmpty
in interface Collection<E extends Enum<E>>
public int getCount()
Set
getCount
in interface Set<E extends Enum<E>>
public Comparator<E> getComparator()
Collection
getComparator
in interface Collection<E extends Enum<E>>
Collection.setComparator(Comparator)
public void setComparator(Comparator<E> comparator)
Collection
Calling this method more than once with the same comparator will re-sort the collection.
setComparator
in interface Collection<E extends Enum<E>>
setComparator
in interface Set<E extends Enum<E>>
comparator
- The comparator used to order elements in the collection, or null if the
collection is unsorted.SetListener.setCleared(Set)
public Iterator<E> iterator()
iterator
in interface Iterable<E extends Enum<E>>
public ListenerList<SetListener<E>> getSetListeners()
Set
getSetListeners
in interface Set<E extends Enum<E>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |