home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-18 | 1.6 KB | 49 lines |
- /*
- * @(#DataCursor.java
- *
- * Copyright (c) 1997 Symantec Corporation. All Rights Reserved.
- *
- */
-
- package symantec.itools.db.beans.binding.databus;
- public interface DataCursor
- {
-
- public DataItem getNextItem();
-
- public DataItem getPreviousItem();
-
-
- //These methods move the cursor to the next or previous item in the sequence of data items and then
- //return the new item. getNextItem() and getPreviousItem() return null to indicate that they are at the end
- //or beginning of the data sequence, respectively.
-
- //For array data, the enumeration of items is indeterminate (may be row major, or column major, etc.),
- //but logical from the point of view of other data sources. Data consumers that need more specific
- //control of the enumeration of multidimensional arrays should subdivide these arrays into vectors
- //(unidimensional arrays) and then enumerate the elements of each vector with ArrayAccess using a
- //cursor.
-
- //Reviewers:
-
- //The last sentence of the previous paragraph needs revision.
-
- public DataItem getCurrentItem();
-
-
- //The getCurrentItem() method returns null for cursors which have been reset, or which have run off the
- // end of the enumeration. So after a loop like
-
- // while (null != (item = aCursor.getNextItem()) {
-
- // }
-
-
- // calls to aCursor.getCurrentItem() will return null until the cursor has been reset by a call to
- //Cursor.reset() and moved forward by aCursor.getNextItem()
-
- public void reset();
-
-
- // This method resets a cursor to the position just before the first item.
- }