com.googlecode.objectify.util.TranslatingIterator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of objectify Show documentation
Show all versions of objectify Show documentation
*** THIS VERSION UPLOADED FOR USE WITH CEDAR-COMMON, TO AVOID DEPENDENCIES ON GOOGLE CODE-BASED MAVEN REPOSITORIES. *** The simplest convenient interface to the Google App Engine datastore
The newest version!
package com.googlecode.objectify.util;
import java.util.Iterator;
/**
* Iterator wrapper that translates from one type to another
*
* @author Jeff Schnitzer
*/
abstract public class TranslatingIterator implements Iterator
{
/** */
protected Iterator base;
/** */
public TranslatingIterator(Iterator base)
{
this.base = base;
}
/**
* You implement this - convert from one object to the other
*/
abstract protected T translate(F from);
@Override
public boolean hasNext()
{
return this.base.hasNext();
}
@Override
public T next()
{
return this.translate(this.base.next());
}
@Override
public void remove()
{
this.base.remove();
}
}