com.googlecode.objectify.util
Class TranslatingIterator<F,T>

java.lang.Object
  extended by com.googlecode.objectify.util.TranslatingIterator<F,T>
All Implemented Interfaces:
java.util.Iterator<T>
Direct Known Subclasses:
TranslatingQueryResultIterator

public abstract class TranslatingIterator<F,T>
extends java.lang.Object
implements java.util.Iterator<T>

Iterator wrapper that translates from one type to another

Author:
Jeff Schnitzer

Field Summary
protected  java.util.Iterator<F> base
           
 
Constructor Summary
TranslatingIterator(java.util.Iterator<F> base)
           
 
Method Summary
 boolean hasNext()
           
 T next()
           
 void remove()
           
protected abstract  T translate(F from)
          You implement this - convert from one object to the other
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

base

protected java.util.Iterator<F> base
Constructor Detail

TranslatingIterator

public TranslatingIterator(java.util.Iterator<F> base)
Method Detail

translate

protected abstract T translate(F from)
You implement this - convert from one object to the other


hasNext

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

next

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

remove

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


Copyright © 2011 Jeff Schnitzer and a gang of pirates. All Rights Reserved. Build version: 3.1