home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / jgl_1_1 / jgl_1_1.exe / src / InputIterator.java < prev    next >
Encoding:
Java Source  |  1996-09-10  |  1.1 KB  |  52 lines

  1. // Copyright(c) 1996 ObjectSpace, Inc.
  2. // Portions Copyright(c) 1995, 1996 Hewlett-Packard Company.
  3.  
  4. package jgl;
  5.  
  6. import java.util.Enumeration;
  7.  
  8. /**
  9.  * InputIterator is the interface of all iterators that can read one
  10.  * item at a time in a forward direction. InputIterator is an extension
  11.  * of the java.lang.Enumeration class.
  12.  * <p>
  13.  * @see jgl.OutputIterator
  14.  * @see java.util.Enumeration
  15.  * @version 1.1
  16.  * @author ObjectSpace, Inc.
  17.  */
  18.  
  19. public interface InputIterator extends Enumeration, Cloneable
  20.   {
  21.   /**
  22.    * Return true if I'm positioned at the first item of my input stream.
  23.    */
  24.   public boolean atBegin();
  25.  
  26.   /**
  27.    * Return true if I'm positioned after the last item in my input stream.
  28.    */
  29.   public boolean atEnd();
  30.  
  31.   /**
  32.    * Return the object at my current position.
  33.    */
  34.   public Object get();
  35.  
  36.   /**
  37.    * Advance by one.
  38.    */
  39.   public void advance();
  40.  
  41.   /**
  42.    * Advance by a specified amount.
  43.    * @param n The amount to advance.
  44.    */
  45.   public void advance( int n );
  46.  
  47.   /**
  48.    * Return a clone of myself.
  49.    */
  50.   public Object clone();
  51.   }
  52.