|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jason.service.crusader.datastructure.graph.GraphNode
This class is an limited implementation of a graph datastructure. This class represents a node in a data graph.
Author - Sanjay"Ironluca"Debnath Ironluca@yahoo.com
Last Modified - 2/07/2001
Field Summary | |
protected java.util.Hashtable |
nodeAttributes
Stores the ttributes of the node - mostly to be set by the server or not at all. |
protected java.util.Hashtable |
nodeList
This variable stores the vertices or the traversal path from this node to child nodes if any. |
protected java.lang.String |
nodeName
The name of a node - unique in it's context. |
protected java.util.Hashtable |
nodeProperties
The parameters associated with a node. |
Constructor Summary | |
GraphNode()
No args default constructor. |
|
GraphNode(java.lang.String nodeName)
Parameterised constructor - initializes the name of this node to the name passed. |
Method Summary | |
void |
addNodeAttributeToTree(java.lang.String childNodeName,
java.lang.String attributeName,
java.lang.String attributeValue)
This is a convenience method to add a nodeAttribute to one particular node in the tree. |
void |
addNodePropertyToTree(java.lang.String childNodeName,
java.lang.String propertyName,
java.lang.String propertyValue)
This is a convenience method to add a nodeProperty to one particular node in the tree. |
GraphNode |
getChildFromTree(java.lang.String childNodeName,
boolean create)
This method retrieves a particular child node from the tree. |
GraphNode |
getChildNode(java.lang.String name)
Returns the particular named child of this node if it exists or "null" if it does not. |
java.lang.Object |
getNodeAttribute(java.lang.String name)
This method returns an named attribute of the node or "null" if one does not exist. |
java.util.Enumeration |
getNodeAttributeNames()
Returns the names of the attributes of the node. |
java.lang.String |
getNodeName()
Returns the unique name of the node in this context - NOTE - it does not return the fully qualified node name from the root. |
java.lang.String |
getNodeProperty(java.lang.String name)
Retrieves a property of a node, if present as indicated by the property name or "null" if the named property does not exist. |
java.util.Enumeration |
getNodePropertyNames()
|
GraphNode |
getParent()
This method retrieves the parent of this node - if any or null. |
boolean |
hasChildNodes()
Convenience method to check wether this node has children or not. |
boolean |
hasParent()
Convenient method to check wether this node has a parent or not. |
void |
removeNodeAttribute(java.lang.String attributeName)
Removes one particular attribute as indicated by the name |
GraphNode |
setChildNode(java.lang.String name,
GraphNode childNode)
Sets a new child node to this node. |
java.lang.String |
setNodeAttribute(java.lang.String name,
java.lang.Object value)
This method is responsible to set a particular attribute of the node. |
void |
setNodeName(java.lang.String nodeName)
Changes the name of the node. |
java.lang.String |
setNodeProperty(java.lang.String name,
java.lang.String value)
This method is responsible to set a particular property of the node. |
GraphNode |
setParent(GraphNode parent)
This method sets a new parent to this node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String nodeName
protected java.util.Hashtable nodeAttributes
protected java.util.Hashtable nodeProperties
protected java.util.Hashtable nodeList
Constructor Detail |
public GraphNode()
public GraphNode(java.lang.String nodeName)
nodeName
- The name to which this node is to be set.Method Detail |
public java.lang.String getNodeName()
public void setNodeName(java.lang.String nodeName)
nodeName
- The name to which the node has to be set.public java.lang.String getNodeProperty(java.lang.String name)
name
- The name of the property to be retrieved.
public java.lang.String setNodeProperty(java.lang.String name, java.lang.String value)
name
- The name of the parameter to be set.value
- The value of the parameter.
public java.util.Enumeration getNodePropertyNames()
public java.lang.Object getNodeAttribute(java.lang.String name)
name
- The name of the attribute the node carries.
public java.lang.String setNodeAttribute(java.lang.String name, java.lang.Object value)
name
- The name of the attribute to be set.value
- The value of the attribute.
public java.util.Enumeration getNodeAttributeNames()
public void removeNodeAttribute(java.lang.String attributeName)
attributeName
- The name of the attribute to be removed.public GraphNode getChildNode(java.lang.String name)
name
- The name of the child node required.
public GraphNode setChildNode(java.lang.String name, GraphNode childNode)
name
- The name under which the child is to be stored.childNode
- The child node that is to be stored.
public GraphNode getParent()
public GraphNode setParent(GraphNode parent)
parent
- The new parent.
public boolean hasParent()
public boolean hasChildNodes()
public void addNodePropertyToTree(java.lang.String childNodeName, java.lang.String propertyName, java.lang.String propertyValue)
childNodeName
- The name of the child node to the existing evaluation node to which this nodeProperty
is to be added.propertyName
- The name of the property.propertyValue
- The value of the property.public void addNodeAttributeToTree(java.lang.String childNodeName, java.lang.String attributeName, java.lang.String attributeValue)
childNodeName
- The name of the child node to the existing evaluation node to which this nodeProperty
is to be added.attributeName
- The name of the attribute.attributeValue
- The value of the attribute.public GraphNode getChildFromTree(java.lang.String childNodeName, boolean create)
childNodeName
- The name of the child node with respect to this node.create
- Creates the series of child nodes and appends them to the tree if "true" - otherwise not.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |