java.lang.Object
org.scopemvc.util.WeakSet.WeakIterator
- All Implemented Interfaces:
- java.util.Iterator
- Enclosing class:
- WeakSet
- class WeakSet.WeakIterator
- extends java.lang.Object
- implements java.util.Iterator
Smart iterator over the contents. Smart because it handles the effects of
garbage collection behind its back.
|
Method Summary |
boolean |
hasNext()
Returns true if the iteration has more elements. |
java.lang.Object |
next()
Returns the next element in the interation. |
void |
remove()
Removes from the underlying collection the last element returned by the
iterator (optional operation). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
iterator
private final java.util.Iterator iterator
- The "real" iterator over the contents
gotNext
private boolean gotNext
- Has the caller obtained the next object yet?
hasNext
private boolean hasNext
- Is there a next object?
next
private java.lang.Object next
- The next object (if any)
WeakSet.WeakIterator
WeakSet.WeakIterator()
hasNext
public boolean hasNext()
- Returns true if the iteration has more elements. (In other
words, returns true if next would return an element
rather than throwing an exception.)
- Specified by:
hasNext in interface java.util.Iterator
next
public java.lang.Object next()
- Returns the next element in the interation.
- Specified by:
next in interface java.util.Iterator
remove
public void remove()
- Removes from the underlying collection the last element returned by the
iterator (optional operation). This method can be called only once per
call to next. The behavior of an iterator is unspecified if
the underlying collection is modified while the iteration is in
progress in any way other than by calling this method.
- Specified by:
remove in interface java.util.Iterator