|
||||||||||
| 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 table
public 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 Setpublic boolean addAll(Collection c)
addAll in interface Setpublic void clear()
clear in interface Setpublic boolean contains(Object o)
contains in interface Setpublic boolean containsAll(Collection c)
containsAll in interface Setpublic boolean equals(Object o)
equals in interface Setpublic int hashCode()
hashCode in interface Setpublic boolean isEmpty()
isEmpty in interface Setpublic Iterator iterator()
iterator in interface Setpublic boolean remove(Object o)
remove in interface Setpublic boolean removeAll(Collection c)
removeAll in interface Setpublic boolean retainAll(Collection c)
retainAll in interface Setpublic int size()
size in interface Setpublic Object[] toArray()
toArray in interface Setpublic Object[] toArray(Object[] a)
toArray in interface Set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||