All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cpt.Hierarchy


java.lang.Object

   |

   +----cpt.Hierarchy


public class Hierarchy
extends Object
A class for handling the operations on the hierarchy stored in a database. Performs expansion of brances on demand, gives information on parents and sons of nodes, and performs matching of strings to the nodes.


Constructor Index

 o Hierarchy()
 o Hierarchy(Long)

Method Index

 o getParent(Long)
Returns the parent Node if the given Node ID.
 o getParent(Node)
Returns the parent Node if the given Node.
 o getPath(Long)
Returns a list of Nodes representing the path of the Node ID.
 o getPath(Node)
Returns a list of Nodes representing the path of the Node.
 o getRoot()
Returns the root node of the hierarchy.
 o getSons(Long)
Returns the list of the son Nodes of a given NodeID.
 o getSons(Node)
Returns the list of the son Nodes of a given Node.
 o main(String[])
Tests the class.
 o match(String)
Looks for entries matching to the string from the hierarchy.

Constructors

 o Hierarchy

 public Hierarchy()

 o Hierarchy

 public Hierarchy(Long rootID)

Methods

 o getRoot

 public Node getRoot()

Returns the root node of the hierarchy.

Returns:
a node representing the root of the hierarchy.
 o getSons

 public Vector getSons(Node fatherNode)

Returns the list of the son Nodes of a given Node. Can be used in the UI for expanding a tree branch etc.

Parameters:
a - node belonging to the hierarchy
Returns:
a vector of Nodes.
 o getSons

 public Vector getSons(Long fatherNodeID)

Returns the list of the son Nodes of a given NodeID. Can be used in the UI for expanding a tree branch etc.

Parameters:
a - long integer representing the id of a node belonging to the hierarchy
Returns:
a vector of Nodes.
 o getParent

 public Node getParent(Node childNode)

Returns the parent Node if the given Node.

Parameters:
a - node belonging to the hierarchy
Returns:
a node.
 o getParent

 public Node getParent(Long childNodeID)

Returns the parent Node if the given Node ID.

Parameters:
a - long integer representing the id of a node belonging to the hierarchy
Returns:
a node.
 o getPath

 public Vector getPath(Node mynode)

Returns a list of Nodes representing the path of the Node.

Parameters:
a - node belonging to the hierarchy
Returns:
a vector of Nodes.
 o getPath

 public Vector getPath(Long mynodeID)

Returns a list of Nodes representing the path of the Node ID.

Parameters:
a - long integer representing the id of a node belonging to the hierarchy
Returns:
a vector of Nodes.
 o match

 public Vector match(String matchString)

Looks for entries matching to the string from the hierarchy.

Parameters:
matchString - the string that is looked for
Returns:
a vector containing references to nodes matching with the string.
 o main

 public static void main(String args[])

Tests the class.



All Packages  Class Hierarchy  This Package  Previous  Next  Index