|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlapisx.util.SafeIteratorSet
This class implements the Set interface backed by a hash table. Iterators returned by a SafeIteratorSet iterate over an unmodifiable snapshot of the set, so it's safe to call add and remove on the original set even while iterators are running. Useful for storing a collection of event listeners.
Field Summary | |
static Debug |
debug
|
Constructor Summary | |
SafeIteratorSet()
Make an empty SafeIteratorSet. |
|
SafeIteratorSet(Collection c)
Make a SafeIteratorSet initialized with the elements of a collection. |
|
SafeIteratorSet(int initialCapacity)
Make a SafeIteratorSet with an initial capacity. |
|
SafeIteratorSet(int initialCapacity,
float loadFactor)
Make a SafeIteratorSet with an initial capacity and load factor. |
Method Summary | |
boolean |
add(Object o)
|
boolean |
addAll(Collection c)
|
void |
clear()
|
boolean |
contains(Object o)
|
boolean |
containsAll(Collection c)
|
boolean |
equals(Object o)
|
int |
hashCode()
|
boolean |
isEmpty()
|
Iterator |
iterator()
Return an iterator over the elements in this set. |
boolean |
remove(Object o)
|
boolean |
removeAll(Collection c)
|
boolean |
retainAll(Collection c)
|
int |
size()
|
Object[] |
toArray()
|
Object[] |
toArray(Object[] a)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static Debug debug
Constructor Detail |
public SafeIteratorSet()
public SafeIteratorSet(Collection c)
c
- Initial members of the setpublic SafeIteratorSet(int initialCapacity)
initialCapacity
- Initial capacity allocated to hash tablepublic SafeIteratorSet(int initialCapacity, float loadFactor)
initialCapacity
- Initial capacity allocated to hash tableloadFactor
- Load factor for hash table.Method Detail |
public boolean add(Object o)
add
in interface Set
public boolean addAll(Collection c)
addAll
in interface Set
public void clear()
clear
in interface Set
public boolean contains(Object o)
contains
in interface Set
public boolean containsAll(Collection c)
containsAll
in interface Set
public boolean equals(Object o)
equals
in interface Set
public int hashCode()
hashCode
in interface Set
public boolean isEmpty()
isEmpty
in interface Set
public Iterator iterator()
iterator
in interface Set
public boolean remove(Object o)
remove
in interface Set
public boolean removeAll(Collection c)
removeAll
in interface Set
public boolean retainAll(Collection c)
retainAll
in interface Set
public int size()
size
in interface Set
public Object[] toArray()
toArray
in interface Set
public Object[] toArray(Object[] a)
toArray
in interface Set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |