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.
-
Hierarchy()
-
-
Hierarchy(Long)
-
-
getParent(Long)
- Returns the parent Node if the given Node ID.
-
getParent(Node)
- Returns the parent Node if the given Node.
-
getPath(Long)
- Returns a list of Nodes representing the path of the Node ID.
-
getPath(Node)
- Returns a list of Nodes representing the path of the Node.
-
getRoot()
- Returns the root node of the hierarchy.
-
getSons(Long)
- Returns the list of the son Nodes of a given NodeID.
-
getSons(Node)
- Returns the list of the son Nodes of a given Node.
-
main(String[])
- Tests the class.
-
match(String)
- Looks for entries matching to the string from the hierarchy.
Hierarchy
public Hierarchy()
Hierarchy
public Hierarchy(Long rootID)
getRoot
public Node getRoot()
- Returns the root node of the hierarchy.
- Returns:
- a node representing the root of the hierarchy.
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.
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.
getParent
public Node getParent(Node childNode)
- Returns the parent Node if the given Node.
- Parameters:
- a - node belonging to the hierarchy
- Returns:
- a node.
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.
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.
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.
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.
main
public static void main(String args[])
- Tests the class.
All Packages Class Hierarchy This Package Previous Next Index