info.aduna.iteration
Class ReducedIteration<E,X extends Exception>

java.lang.Object
  extended by info.aduna.iteration.CloseableIterationBase<E,X>
      extended by info.aduna.iteration.IterationWrapper<E,X>
          extended by info.aduna.iteration.FilterIteration<E,X>
              extended by info.aduna.iteration.ReducedIteration<E,X>
All Implemented Interfaces:
CloseableIteration<E,X>, Iteration<E,X>

public class ReducedIteration<E,X extends Exception>
extends FilterIteration<E,X>

Removes consecutive duplicates from the object stream.

Author:
Arjohn Kampman

Field Summary
 
Fields inherited from class info.aduna.iteration.IterationWrapper
wrappedIter
 
Constructor Summary
ReducedIteration(Iteration<? extends E,? extends X> delegate)
           
 
Method Summary
protected  boolean accept(E nextObject)
          Tests whether or not the specified object should be returned by this Iteration.
 
Methods inherited from class info.aduna.iteration.FilterIteration
handleClose, hasNext, next
 
Methods inherited from class info.aduna.iteration.IterationWrapper
remove
 
Methods inherited from class info.aduna.iteration.CloseableIterationBase
close, isClosed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReducedIteration

public ReducedIteration(Iteration<? extends E,? extends X> delegate)
Method Detail

accept

protected boolean accept(E nextObject)
Description copied from class: FilterIteration
Tests whether or not the specified object should be returned by this Iteration. All objects from the wrapped Iteration pass through this method in the same order as they are coming from the wrapped Iteration.

Specified by:
accept in class FilterIteration<E,X extends Exception>
Parameters:
nextObject - The object to be tested.
Returns:
true if the object should be returned, false otherwise.


Copyright © 2001-2012 Aduna. All Rights Reserved.