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

  1. // Copyright(c) 1996 ObjectSpace, Inc.
  2. // Portions Copyright(c) 1995, 1996 Hewlett-Packard Company.
  3.  
  4. package jgl;
  5.  
  6. /**
  7.  * BidirectionalIterator is the interface of all iterators that can 
  8.  * read and/or write one item at a time in a forwards or backwards direction. 
  9.  * <p>
  10.  * @version 1.1
  11.  * @author ObjectSpace, Inc.
  12.  */
  13.  
  14. public interface BidirectionalIterator extends ForwardIterator
  15.   {
  16.   /**
  17.    * J++ requires clone 
  18.    */
  19.   public Object clone();
  20.  
  21.   /**
  22.    * Retreat by one.
  23.    */
  24.   public void retreat();
  25.  
  26.   /**
  27.    * Retreat by a specified amount.
  28.    * @param n The amount to retreat.
  29.    */
  30.   public void retreat( int n );
  31.  
  32.   /**
  33.    * Return the object that is a specified distance from my current position.
  34.    * @param offset The offset from my current position.
  35.    */
  36.   public Object get( int offset );
  37.  
  38.   /**
  39.    * Return the object at my current position.
  40.    */
  41.   public Object get();
  42.  
  43.   /**
  44.    * Replace the object at a specified distance from my current position.
  45.    * @param offset The offset from my current position.
  46.    * @param object The object to write.
  47.    */
  48.   public void put( int offset, Object object );
  49.   }
  50.  
  51.