net.datastructures
Class DNode<E>
java.lang.Object
net.datastructures.DNode<E>
- All Implemented Interfaces:
- Position<E>
public class DNode<E>
- extends java.lang.Object
- implements Position<E>
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 |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DNode
public DNode(DNode<E> newPrev,
DNode<E> newNext,
E elem)
- Constructor
element
public E element()
throws InvalidPositionException
- Description copied from interface:
Position
- Return the element stored at this position.
- Specified by:
element
in interface Position<E>
- Throws:
InvalidPositionException
getNext
public DNode<E> getNext()
getPrev
public DNode<E> getPrev()
setNext
public void setNext(DNode<E> newNext)
setPrev
public void setPrev(DNode<E> newPrev)
setElement
public void setElement(E newElement)