pqrtree
Class ListNode

java.lang.Object
  extended by pqrtree.ListNode

public class ListNode
extends java.lang.Object

A ListNode is the element of the DoublyLinkedList, consisting of a pointer to its buddy, to the next node, and to another object.

Version:
0.1
Author:
Bruno Dilly
See Also:
DoublyLinkedList

Field Summary
private  java.lang.Object data
           
private  ListNode dir1
           
private  ListNode dir2
           
 
Constructor Summary
ListNode(java.lang.Object data)
          Creates a list node that stores an object.
 
Method Summary
 java.lang.Object getData()
          Gets the data stored by the list node, usually a tree node, or another list node.
 ListNode getDir1()
          Getss the neighbor element of the list node in direction 1.
 ListNode getDir2()
          Gets the neighbor element of the list node in direction 2.
 ListNode getNext(ListNode iterator)
          Gets the next element of the list node.
 void removeMe()
          Remove the node of the list it belongs.
 void setData(java.lang.Object o)
           
 void setDir1(ListNode n)
          Sets the neighbor element of the list node in direction 1.
 void setDir2(ListNode n)
          Sets the neighbor element of the list node in direction 2.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dir1

private ListNode dir1

dir2

private ListNode dir2

data

private java.lang.Object data
Constructor Detail

ListNode

public ListNode(java.lang.Object data)
Creates a list node that stores an object.

Parameters:
data - Object that must be stored.
Method Detail

getNext

public ListNode getNext(ListNode iterator)
Gets the next element of the list node.

Parameters:
iterator - The iterator is a list node that stores the previous list node, or the head, when its the first step of a loop.
Returns:
Next list node.

setDir1

public void setDir1(ListNode n)
Sets the neighbor element of the list node in direction 1.

Parameters:
n - Neighbor list node.

setDir2

public void setDir2(ListNode n)
Sets the neighbor element of the list node in direction 2.

Parameters:
n - Neighbor list node.

getDir1

public ListNode getDir1()
Getss the neighbor element of the list node in direction 1.

Returns:
Neighbor list node.

getDir2

public ListNode getDir2()
Gets the neighbor element of the list node in direction 2.

Returns:
Neighbor list node.

getData

public java.lang.Object getData()
Gets the data stored by the list node, usually a tree node, or another list node.

Returns:
The object stored, a list or tree node.

setData

public void setData(java.lang.Object o)

removeMe

public void removeMe()
Remove the node of the list it belongs.