Algorithm
Development Kit 1.0

algs.model.list
Class DoubleNode<E>

java.lang.Object
  extended by algs.model.list.DoubleNode<E>
Type Parameters:
E - Type of the values stored by the underlying nodes.

public class DoubleNode<E>
extends java.lang.Object

Double Linked list of elements parameterized by class E.

Since:
1.0
Version:
1.0, 6/15/08
Author:
George Heineman

Constructor Summary
DoubleNode(E e)
          Construct node from the given element.
 
Method Summary
 DoubleNode<E> next()
          Return next.
 void next(DoubleNode<E> n)
          Modifies the next link for this node.
 DoubleNode<E> prev()
          Return previous.
 void prev(DoubleNode<E> p)
          Modifies the previous link for this node.
 java.lang.String toString()
          Return meaningful string.
 E value()
          Return value stored with the node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DoubleNode

public DoubleNode(E e)
Construct node from the given element.

Parameters:
e - Element to store with the node.
Method Detail

value

public E value()
Return value stored with the node.


prev

public DoubleNode<E> prev()
Return previous.


next

public DoubleNode<E> next()
Return next.


toString

public java.lang.String toString()
Return meaningful string.

Overrides:
toString in class java.lang.Object

prev

public void prev(DoubleNode<E> p)
Modifies the previous link for this node.

This is a dangerous operation and exposed only because algorithms often must make specific changes whose correctness is known only to them.

If you modify this link directly, then the DoubleLinkedList may incorrectly have the number of items in the list. Make sure you call 'resetSize' after making any specific changes using this method.

You have been warned.

Parameters:
p -

next

public void next(DoubleNode<E> n)
Modifies the next link for this node.

This is a dangerous operation and exposed only because algorithms often must make specific changes whose correctness is known only to them.

If you modify this link directly, then the DoubleLinkedList may incorrectly have the number of items in the list. Make sure you call 'resetSize' after making any specific changes using this method.

You have been warned.

Parameters:
n -

Algorithm Development Kit 1.0

This code supports the Algorithms in a Nutshell book, published by O'Reilly Media, Inc. in November 2008. Please visit the book web page to learn of any changes to the code repository or to record a potential defect.