javatools.datatypes
Class MappedIterator<S,T>
java.lang.Object
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
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
stringMapper
public static MappedIterator.Map<java.lang.Object,java.lang.String> stringMapper
- An iterator that maps an object to a string
MappedIterator
public MappedIterator(java.util.Iterator<S> i,
MappedIterator.Map<? super S,? extends T> m)
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