package rpi.goldsd.container;
/**
* The Linkable interface defines the methods required by any
* object that can be linked into a linked list or other such linked
* structure. Note that the Linkable interface defines methods
* for a doubly-linked structure. If a singly-linked structure is to be
* used, the getPrevious() and setPrevious() methods
* may be implemented as empty methods.
*
* @see ListNode
* @see LinkedList
* @version 1.0, 3/15/98
* @author David Goldschmidt
*/
public interface Linkable
{
/**
* Returns a reference to the next element in the list.
* @return a reference to the next element in the list.
*/
public Linkable getNext();
/**
* Returns a reference to the previous element in the list.
* @return a reference to the previous element in the list.
*/
public Linkable getPrevious();
/**
* Establishes a link to the next element in the list.
* @param node a reference to the next element in the list to
* be linked to this Linkable object.
*/
public void setNext( Linkable node );
/**
* Establishes a link to the previous element in the list.
* @param node a reference to the previous element in the list
* to be linked to this Linkable object.
*/
public void setPrevious( Linkable node );
}