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

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

public class AdaptingIterator<O,I>
extends java.lang.Object
implements java.util.Iterator<O>

An iterator that adapts a type to another type.

Version:
$Revision$
Author:
Julien Viet

Constructor Summary
AdaptingIterator(java.util.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(java.util.Iterator<I> iterator,
                        TypeAdapter<O,I> adapter)
                 throws java.lang.NullPointerException
Build a new adapting iterator.

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

hasNext

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

next

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

remove

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


Copyright © 2011 eXo Platform SAS. All Rights Reserved.