Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.scopemvc.util
Class WeakSet.WeakIterator  view WeakSet.WeakIterator download WeakSet.WeakIterator.java

java.lang.Object
  extended byorg.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.


Field Summary
private  boolean gotNext
          Has the caller obtained the next object yet?
private  boolean hasNext
          Is there a next object?
private  java.util.Iterator iterator
          The "real" iterator over the contents
private  java.lang.Object next
          The next object (if any)
 
Constructor Summary
(package private) WeakSet.WeakIterator()
           
 
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
 

Field Detail

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)

Constructor Detail

WeakSet.WeakIterator

WeakSet.WeakIterator()
Method Detail

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