home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VCafe / prosrc.bin / DataCursor.java < prev    next >
Encoding:
Java Source  |  1998-03-18  |  1.6 KB  |  49 lines

  1. /*
  2.  * @(#DataCursor.java
  3.  *
  4.  * Copyright (c) 1997 Symantec Corporation. All Rights Reserved.
  5.  *
  6.  */
  7.  
  8. package symantec.itools.db.beans.binding.databus;
  9. public interface DataCursor
  10. {
  11.  
  12. public DataItem getNextItem();
  13.  
  14. public DataItem getPreviousItem();
  15.  
  16.  
  17.      //These methods move the cursor to the next or previous item in the sequence of data items and then
  18.      //return the new item. getNextItem() and getPreviousItem() return null to indicate that they are at the end
  19.      //or beginning of the data sequence, respectively.
  20.  
  21.      //For array data, the enumeration of items is indeterminate (may be row major, or column major, etc.),
  22.      //but logical from the point of view of other data sources. Data consumers that need more specific
  23.      //control of the enumeration of multidimensional arrays should subdivide these arrays into vectors
  24.      //(unidimensional arrays) and then enumerate the elements of each vector with ArrayAccess using a
  25.      //cursor.
  26.  
  27. //Reviewers:
  28.  
  29.      //The last sentence of the previous paragraph needs revision.
  30.  
  31. public DataItem getCurrentItem();
  32.  
  33.  
  34.      //The getCurrentItem() method returns null for cursors which have been reset, or which have run off the
  35.     // end of the enumeration. So after a loop like
  36.  
  37.     // while (null != (item = aCursor.getNextItem()) {
  38.  
  39.     // }
  40.  
  41.  
  42.     // calls to aCursor.getCurrentItem() will return null until the cursor has been reset by a call to
  43.      //Cursor.reset() and moved forward by aCursor.getNextItem()
  44.  
  45. public void reset();
  46.  
  47.  
  48.     // This method resets a cursor to the position just before the first item.
  49. }