com.sdm.quasar.client.core.common.util
Class AbstractFilterIterator

java.lang.Object
  extended bycom.sdm.quasar.client.core.common.util.AbstractFilterIterator
All Implemented Interfaces:
java.util.Iterator

public abstract class AbstractFilterIterator
extends java.lang.Object
implements java.util.Iterator

An implementation of Iterator, that allows to filter the returned elements by implementing the abstract method accept(Object).

Since:
GOOL 1.2.3
Author:
Thomas Wolf

Constructor Summary
AbstractFilterIterator(java.util.Iterator iterator)
          Creates a new AbstractFilterIterator based upon the given Iterator.
 
Method Summary
abstract  boolean accept(java.lang.Object next)
          Returns true, if the given object will be accepted to be returned by next().
 java.util.Iterator getIterator()
          Returns the original Iterator.
 boolean hasNext()
           
 java.lang.Object next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFilterIterator

public AbstractFilterIterator(java.util.Iterator iterator)
Creates a new AbstractFilterIterator based upon the given Iterator.

Parameters:
iterator - the original Iterator to use.
Method Detail

accept

public abstract boolean accept(java.lang.Object next)
Returns true, if the given object will be accepted to be returned by next().

Parameters:
next - the object to be checked for acceptance
Returns:
true, if the given object will be accepted to be returned by next().

getIterator

public java.util.Iterator getIterator()
Returns the original Iterator.

Returns:
the original Iterator.

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()
Specified by:
remove in interface java.util.Iterator