com.vgrs.xcode.util
Class InputIterator

java.lang.Object
  extended by com.vgrs.xcode.util.InputIterator
All Implemented Interfaces:
java.util.Iterator<java.lang.Object>

public class InputIterator
extends java.lang.Object
implements java.util.Iterator<java.lang.Object>

Create an iterator over an InputStream object.

Version:
1.0
Author:
John Colosi

Constructor Summary
InputIterator(java.io.InputStream r)
           
 
Method Summary
 boolean hasNext()
          Determine if the last line has already been read.
 java.lang.Object next()
          Retrieve the next line of content.
 void remove()
          Removes from the underlying collection the last element returned by the iterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputIterator

public InputIterator(java.io.InputStream r)
Method Detail

hasNext

public boolean hasNext()
Determine if the last line has already been read.

Specified by:
hasNext in interface java.util.Iterator<java.lang.Object>
Returns:
true if the InputStream has been read completely.

next

public java.lang.Object next()
                      throws java.util.NoSuchElementException
Retrieve the next line of content.

Specified by:
next in interface java.util.Iterator<java.lang.Object>
Returns:
The next line of content in a String object.
Throws:
java.util.NoSuchElementException - If the InputStream has been read completely.

remove

public void remove()
            throws java.lang.UnsupportedOperationException
Removes from the underlying collection the last element returned by the iterator. (Not Supported)

Specified by:
remove in interface java.util.Iterator<java.lang.Object>
Throws:
java.lang.UnsupportedOperationException - This exception is always thrown.


Copyright © 2000-2010 VeriSign Inc. All Rights Reserved