org.bsf.smartValueObject.container
Class SmartIterator

java.lang.Object
  |
  +--org.bsf.smartValueObject.container.SmartIterator
All Implemented Interfaces:
java.util.Iterator

public class SmartIterator
extends java.lang.Object
implements java.util.Iterator

A replacement for java.util.Iterator.

This iterator respects the state of versionable objects, as they can be marked 'deleted' and should not be given out by an interator. It is configured via an VersionableFilter.

See Also:
SmartCollection, SmartMap, VersionableFilter

Field Summary
private  org.bsf.smartValueObject.VersionableFilter filter
          This filter decides which objects are visible to the user.
private  java.util.Iterator it
          The underlying iterator.
private  java.lang.Object next
           
private static java.lang.Object NOOBJECT
          Marker object as placeholder.
 
Constructor Summary
SmartIterator(java.util.Iterator it, org.bsf.smartValueObject.VersionableFilter f)
          Initializes this iterator with another iterator and a VersionableFilter.
 
Method Summary
 boolean hasNext()
           
 java.lang.Object next()
           
 void remove()
          We dont't support this.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOOBJECT

private static final java.lang.Object NOOBJECT
Marker object as placeholder.


it

private java.util.Iterator it
The underlying iterator.


next

private java.lang.Object next

filter

private org.bsf.smartValueObject.VersionableFilter filter
This filter decides which objects are visible to the user.

Constructor Detail

SmartIterator

public SmartIterator(java.util.Iterator it,
                     org.bsf.smartValueObject.VersionableFilter f)
Initializes this iterator with another iterator and a VersionableFilter.

Parameters:
it - the underlying iterator.
f - the filter to use while iterating.
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator

remove

public void remove()
We dont't support this.

Specified by:
remove in interface java.util.Iterator