org.chromattic.common
Class AdaptingIterator<O,I>

java.lang.Object
  extended by org.chromattic.common.AdaptingIterator<O,I>
Type Parameters:
O - the outter type
I - the inner type
All Implemented Interfaces:
Iterator<O>

public class AdaptingIterator<O,I>
extends Object
implements Iterator<O>

An iterator that adapts a type to another type.

Version:
$Revision$
Author:
Julien Viet

Constructor Summary
AdaptingIterator(Iterator<I> iterator, TypeAdapter<O,I> adapter)
          Build a new adapting iterator.
 
Method Summary
 boolean hasNext()
           
 O next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdaptingIterator

public AdaptingIterator(Iterator<I> iterator,
                        TypeAdapter<O,I> adapter)
                 throws NullPointerException
Build a new adapting iterator.

Parameters:
iterator - the iterator
adapter - the adapter
Throws:
NullPointerException - if any argument is null
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<O>

next

public O next()
Specified by:
next in interface Iterator<O>

remove

public void remove()
Specified by:
remove in interface Iterator<O>


Copyright © 2010 eXo Platform SAS. All Rights Reserved.