package lists; /* * ADT List * -------- * * A List is a sequential structure that is either empty or it has a * sequence of nodes such that one node is the first, one node is the * last, and each node except the last has a unique successor. Finally, * one node in a non-empty list is designated as the current node. * * The list supports the following operations: * * List - makes an empty list * * boolean isEmpty() - checks if list is empty * boolean isFull() - checks if List if full * boolean isFirst() - checks if current is the first * boolean isLast() - checks if current is the last * int getSize() - returns number of elements in the list * * void first() - makes current the first * void next() - makes current the successor of current * * void add(Object obj) - adds obj to the list * void delete() - removes current object from list * * void set(Object obj - changes current object to obj * Object get() - returns object at current position */ public interface ADTList { /* PRE/POST ... */ public abstract boolean isEmpty(); public abstract boolean isFull(); public abstract boolean isFirst(); public abstract boolean isLast(); public abstract int getSize(); public abstract void first(); public abstract void next(); public abstract void add(Object obj); public abstract void delete(); public abstract void set(Object obj); public abstract Object get(); }