home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / jgl_1_1 / src / randomaccessiterator.java < prev    next >
Encoding:
Java Source  |  1996-09-10  |  884 b   |  35 lines

  1. // Copyright(c) 1996 ObjectSpace, Inc.
  2. // Portions Copyright(c) 1995, 1996 Hewlett-Packard Company.
  3.  
  4. package jgl;
  5.  
  6. /**
  7.  * RandomAccessIterator is the interface of all iterators that can 
  8.  * read and/or write one item at a time in a forwards or backwards 
  9.  * direction. In addition, two random access iterators may be efficiently
  10.  * compared for their relative location to each other.
  11.  * <p>
  12.  * @version 1.1
  13.  * @author ObjectSpace, Inc.
  14.  */
  15.  
  16. public interface RandomAccessIterator extends BidirectionalIterator
  17.   {
  18.   /**
  19.    * Return the index of my current position.
  20.    */
  21.   public int index();
  22.  
  23.   /**
  24.    * Return true if I'm before a specified iterator.
  25.    * @param iterator The iterator to compare myself against.
  26.    */
  27.   public boolean less( RandomAccessIterator iterator );
  28.  
  29.   /**
  30.    * Return a clone of myself.
  31.    */
  32.   public Object clone();
  33.   }
  34.  
  35.