net.datastructures
Class DNode
java.lang.Object
net.datastructures.DNode
- All Implemented Interfaces:
- Position
- public class DNode
- extends Object
- implements Position
A simple node class for a doubly-linked list. Each DNode has a
reference to a stored element, a previous node, and a next node.
- Author:
- Roberto Tamassia
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DNode
public DNode(DNode newPrev,
DNode newNext,
Object elem)
element
public Object element()
throws InvalidPositionException
- Description copied from interface:
Position
- Returns the element stored at this position.
- Specified by:
element
in interface Position
- Throws:
InvalidPositionException
getNext
public DNode getNext()
getPrev
public DNode getPrev()
setNext
public void setNext(DNode newNext)
setPrev
public void setPrev(DNode newPrev)
setElement
public void setElement(Object newElement)