datastructures

net.datastructures
Class DNode

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

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

Constructor Detail

DNode

public DNode(DNode newPrev,
             DNode newNext,
             Object elem)
Method Detail

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)

datastructures