net.datastructures
Class DNode<E>

java.lang.Object
  extended by 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

Constructor Summary
DNode(DNode<E> newPrev, DNode<E> newNext, E elem)
          Constructor
 
Method Summary
 E element()
          Return the element stored at this position.
 DNode<E> getNext()
           
 DNode<E> getPrev()
           
 void setElement(E newElement)
           
 void setNext(DNode<E> newNext)
           
 void setPrev(DNode<E> newPrev)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DNode

public DNode(DNode<E> newPrev,
             DNode<E> newNext,
             E elem)
Constructor

Method Detail

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)