javatools.datatypes
Class MappedIterator<S,T>

java.lang.Object
  extended by javatools.datatypes.MappedIterator<S,T>
All Implemented Interfaces:
java.io.Closeable, java.lang.Iterable<T>, java.util.Iterator<T>

public class MappedIterator<S,T>
extends java.lang.Object
implements java.util.Iterator<T>, java.lang.Iterable<T>, java.io.Closeable

This class is part of the Java Tools (see http://mpii.de/yago-naga/javatools). It is licensed under the Creative Commons Attribution License (see http://creativecommons.org/licenses/by/3.0) by the YAGO-NAGA team (see http://mpii.de/yago-naga). The class wraps an iterator and translates each element before returning it


Nested Class Summary
static interface MappedIterator.Map<A,B>
           
 
Field Summary
static MappedIterator.Map<java.lang.Object,java.lang.String> stringMapper
          An iterator that maps an object to a string
 
Constructor Summary
MappedIterator(java.util.Iterator<S> i, MappedIterator.Map<? super S,? extends T> m)
           
 
Method Summary
 void close()
           
 boolean hasNext()
           
 java.util.Iterator<T> iterator()
           
 T next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stringMapper

public static MappedIterator.Map<java.lang.Object,java.lang.String> stringMapper
An iterator that maps an object to a string

Constructor Detail

MappedIterator

public MappedIterator(java.util.Iterator<S> i,
                      MappedIterator.Map<? super S,? extends T> m)
Method Detail

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>

iterator

public java.util.Iterator<T> iterator()
Specified by:
iterator in interface java.lang.Iterable<T>

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Throws:
java.io.IOException