util
Class LinkedList

java.lang.Object
  extended by util.LinkedList

public class LinkedList
extends java.lang.Object

LinkedList implements the Linked list holding the current,first and last nodes

Author:
shankar

Field Summary
 Node current
          Current Node
 Node first
          First Node
 Node last
          Last Node
 
Constructor Summary
LinkedList()
          Constructs a blank LinkedList
LinkedList(Node node)
          Construts a LinkedList with one Node
 
Method Summary
 void appendNode(Node node)
          Appends the node after the current node in LinkedList
 Node getNext()
          Finds the next node and returns node if it is valid or null.
 Node getPrevious()
          Finds the previous node and returns node if it is valid or null.
 boolean isValid()
          Test if the current position is a valid position in the list.
 void removeNode(Node node)
          Removes the Specified node from the LinkedList
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

current

public Node current
Current Node


first

public Node first
First Node


last

public Node last
Last Node

Constructor Detail

LinkedList

public LinkedList()
Constructs a blank LinkedList


LinkedList

public LinkedList(Node node)
Construts a LinkedList with one Node

Parameters:
node -
Method Detail

isValid

public boolean isValid()
Test if the current position is a valid position in the list.

Returns:
true if the current position is valid.

getPrevious

public Node getPrevious()
Finds the previous node and returns node if it is valid or null.

Returns:
previous Node

getNext

public Node getNext()
Finds the next node and returns node if it is valid or null.

Returns:
next Node

appendNode

public void appendNode(Node node)
Appends the node after the current node in LinkedList

Parameters:
node -

removeNode

public void removeNode(Node node)
Removes the Specified node from the LinkedList

Parameters:
node -