org.apache.stanbol.entityhub.servicesapi.util
Class ToStringIterator

java.lang.Object
  extended by org.apache.stanbol.entityhub.servicesapi.util.ToStringIterator
All Implemented Interfaces:
Iterator<String>

public class ToStringIterator
extends Object
implements Iterator<String>

Implementation of an Iterator over String values, that uses the Object.toString() on elements of the parent Iterator for the conversion.

This Implementation does not use AdaptingIterators implementation, because the Object.toString() method can be used to create a string representation for every object and therefore there is no need for the filtering functionality provided by the AdaptingIterator.

Author:
Rupert Westenthaler

Constructor Summary
ToStringIterator(Iterator<?> it)
          Creates an string iterator over parsed parent
 
Method Summary
 boolean hasNext()
           
 String next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToStringIterator

public ToStringIterator(Iterator<?> it)
                 throws NullPointerException
Creates an string iterator over parsed parent

Parameters:
it - the parent iterator
Throws:
NullPointerException - if null is parsed as parent iterator
Method Detail

remove

public final void remove()
Specified by:
remove in interface Iterator<String>

next

public final String next()
Specified by:
next in interface Iterator<String>

hasNext

public final boolean hasNext()
Specified by:
hasNext in interface Iterator<String>


Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.