Begin versioning.
[fits.git] / src / nom / tam / util / Cursor.java
1 package nom.tam.util;
2
3 /** This interface extends the Iterator interface
4  *  to allow insertion of data and move to previous entries
5  *  in a collection.
6  */
7 public interface Cursor extends java.util.Iterator {
8
9     /** Is there a previous element in the collection? */
10     public abstract boolean hasPrev();
11
12     /** Get the previous element */
13     public abstract Object prev() throws java.util.NoSuchElementException;
14
15     /** Point the list at a particular element.
16      *  Point to the end of the list if the key is not found.
17      */
18     public abstract void setKey(Object key);
19
20     /** Add an unkeyed element to the collection.
21      *  The new element is placed such that it will be called
22      *  by a prev() call, but not a next() call.
23      */
24     public abstract void add(Object reference);
25
26     /** Add a keyed element to the collection.
27      *  The new element is placed such that it will be called
28      *  by a prev() call, but not a next() call.
29      */
30     public abstract void add(Object key, Object reference);
31 }