org.eclipse.higgins.idas.cp.rdf.util
Class SelectingIterator

java.lang.Object
  extended byorg.eclipse.higgins.idas.cp.rdf.util.ReadOnlyIterator
      extended byorg.eclipse.higgins.idas.cp.rdf.util.SelectingIterator
All Implemented Interfaces:
Iterator
Direct Known Subclasses:
NotNullIterator

public abstract class SelectingIterator
extends ReadOnlyIterator

An iterator that returns only elements of another iterator that satisfy a certain condition. In order for the hasNext() function to behave correctly, the iterator always looks ahead one element.

Author:
msabadello at parityinc dot net

Constructor Summary
SelectingIterator(Iterator iterator)
           
 
Method Summary
 boolean hasNext()
           
 Object next()
           
abstract  boolean select(Object item)
           
 
Methods inherited from class org.eclipse.higgins.idas.cp.rdf.util.ReadOnlyIterator
remove
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectingIterator

public SelectingIterator(Iterator iterator)
Method Detail

hasNext

public boolean hasNext()

next

public Object next()

select

public abstract boolean select(Object item)