|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.pietschy.command.util.WeakSet<T>
public class WeakSet<T>
A utility class based on a HashSet that only keeps weak references to
its objects.
This class does not implement Set and only provides access
to its member via an iterator.
| Field Summary | |
|---|---|
(package private) com.pietschy.command.util.WeakSet.WeakIterator<T> |
iterator
|
| Constructor Summary | |
|---|---|
WeakSet()
Creats a new instance with the default size of 10. |
|
WeakSet(int size)
Creates a new instance with the initial size |
|
| Method Summary | |
|---|---|
boolean |
add(T o)
Add the specified object to the set. |
java.util.List<T> |
asList()
Creates an returns a standard list containing all the objects in this set. |
boolean |
contains(java.lang.Object o)
Checks if the set contains the specified object. |
boolean |
isEmpty()
Checks if the set is empty. |
java.util.Iterator<T> |
iterator()
Returns an interator over the objects in the set. |
boolean |
remove(java.lang.Object o)
Removes the specified object from the set. |
void |
removeAll()
Removes all the object from the set. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
com.pietschy.command.util.WeakSet.WeakIterator<T> iterator
| Constructor Detail |
|---|
public WeakSet()
public WeakSet(int size)
size - the initial size.| Method Detail |
|---|
public boolean isEmpty()
true if the set is empty, false otherwise.public boolean add(T o)
o - the object to add.
true if the object was added, false otherwise.public boolean remove(java.lang.Object o)
o - the object to remove.
true if the object was removed, false otherwise.public void removeAll()
public boolean contains(java.lang.Object o)
o - the object to check.
true if the set contains the object, false otherwise.public java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T>public java.util.List<T> asList()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||