Class DoubleNode

java.lang.Object
  extended by DoubleNode

public class DoubleNode
extends java.lang.Object

The class DoubleNode holds two pointers and a character. It is used to represent a single node on a double linked list.

Author:
mm6

Constructor Summary
DoubleNode()
          Constructor with no arguments.
DoubleNode(DoubleNode p, char ch, DoubleNode n)
          Constructor
 
Method Summary
 char getC()
           
 DoubleNode getNext()
           
 DoubleNode getPrev()
           
static void main(java.lang.String[] args)
          Test driver for DoubleNode
 void setC(char c)
           
 void setNext(DoubleNode next)
           
 void setPrev(DoubleNode prev)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DoubleNode

public DoubleNode(DoubleNode p,
                  char ch,
                  DoubleNode n)
Constructor

Parameters:
p - is a pointer to a previous node.
n - is a pointer to a next node.
ch - is a character for this node.

DoubleNode

public DoubleNode()
Constructor with no arguments. Assign null values to previous, next and the null character to c.

Method Detail

getPrev

public DoubleNode getPrev()
Returns:
a pointer to the previous node or null if none exists

setPrev

public void setPrev(DoubleNode prev)

getNext

public DoubleNode getNext()

setNext

public void setNext(DoubleNode next)

getC

public char getC()

setC

public void setC(char c)
Parameters:
char - c is assigned to this node

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)
Test driver for DoubleNode