Class Node<E>

java.lang.Object
  extended by Node<E>

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

This class represents a node to be used in a Queue

Author:
Sameh Fakhouri

Constructor Summary
Node(E data)
          Constructor that for the Node class
Node(E data, Node<E> next)
          Constructor that for the Node class
 
Method Summary
 E getData()
          Getter method to obtain a reference to the Object held by the LinkedListNode.
 Node<E> getNext()
          Getter method to obtain a reference to the next LinkedListNode in the Linked List.
 void setData(E data)
          Setter method to set the reference to the Object held by the LinkedListNode.
 void setNext(Node<E> next)
          Setter method to set the reference to the next LinkedListNode in the Linked List.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Node

public Node(E data)
Constructor that for the Node class

Parameters:
data - This is the data Object held by the LinkedListNode.

Node

public Node(E data,
            Node<E> next)
Constructor that for the Node class

Parameters:
data - This is the data Object held by the Node.
next - This is the pointer to the next LinkedListNode in the Linked List.
Method Detail

getData

public E getData()
Getter method to obtain a reference to the Object held by the LinkedListNode.

Returns:
The Object held by the Node.

setData

public void setData(E data)
Setter method to set the reference to the Object held by the LinkedListNode.

Parameters:
data - The reference to the Object to be held by the LinkedListNode.

getNext

public Node<E> getNext()
Getter method to obtain a reference to the next LinkedListNode in the Linked List.

Returns:
The next LinkedListNode in the Linked List.

setNext

public void setNext(Node<E> next)
Setter method to set the reference to the next LinkedListNode in the Linked List.

Parameters:
next - The reference to the next LinkedListNode in the Linked List.