Class Node

java.lang.Object
   |
   +--Node

public class Node

A Node is composed of a String value (class name), a String type (obj || rel) and a Vector of attributes (of the class).

Field Summary
 Vector attributes
          The vector containing all attributes of the Node.
 String type
          The type, represented as a string , can be "obj" or "rel" depending of tag is a class or a relation.
 String value
          The value, represented as a string , for the class-name.
 

Constructor Summary
Node()
          Creates a Node with value = "", type = "", and an empty vector of attributes.
Node(String val, String type, Vector attrib)
          Creates a Node with value = val, type = type, and attributes = attrib.
 

Method Summary
 Vector getAttributes()
          Returns the Vector of attributes of this Node.
static
DefaultMutableTreeNode
getNode(DefaultMutableTreeNode rootNode, String nameClass)
          Returns the first DefaultMutableTreeNode which value equals nameClass from rootNode parent.
 String getType()
          Returns the type of this Node, that is to say returns "obj" if Node is a class and "rel" if Node is a relation.
 String getValue()
          Returns the value of this Node, that is to say the class name.
 void printNodeInfo()
          Print on the standard output some info of this Node : the value, the type and for each attribute, its name and its type.
 void setAttributes(Vector attrib)
          Set the attributes of this Node with Vector attrib.
 void setType(String type)
          Set the type of this Node with type.
 void setValue(String val)
          Set the value of this Node with val.
 String toString()
          Returns the string representation of this Node.
 

Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

attributes

Vector attributes
The vector containing all attributes of the Node. The vector can be empty and then, its size equals 0.

type

String type
The type, represented as a string , can be "obj" or "rel". Type is determined when parsing ontology depends if tag encoutered is a class or a relation.

value

String value
The value, represented as a string , for the class-name. Value is determined when parsing ontology with the value of attribute name of the tag class or relation.

Constructor Detail

Node

public Node()

Creates a Node with value = "", type = "", and an empty vector of attributes. Each field is initialized.


Node

public Node(String val, String type, Vector attrib)

Creates a Node with value = val, type = type, and attributes = attrib.

Parameters
val - the value of the node.
type - the type of the node.
attrib - the vector of attributes of the node.

Method Detail

getAttributes

public Vector getAttributes()
Returns the Vector of attributes of this Node.
Returns :
the Vector of attributes.
See also :
setAttributes(java.util.Vector)

getNode

public static DefaultMutableTreeNode getNode(DefaultMutableTreeNode rootNode,
                                             String nameClass)
Returns the first DefaultMutableTreeNode which value equals nameClass from rootNode parent.
Parameters :
rootNode - the DefaultMutableTreeNode parent.
nameClass - the String class name.
Returns :
a DefaultMutableTreeNode.

getType

public String getType()
Returns the type of this Node, that is to say returns "obj" if Node is a class and "rel" if Node is a relation.
Returns :
the String type.
See also :
setType(java.lang.String)

getValue

public String getValue()
Returns the value of this Node, that is to say the class name.
Returns :
the String value.
See also :
setValue(java.lang.String)

printNodeInfo

public void printNodeInfo()
Print on the standard output some info of this Node : the value, the type and for each attribute, its name and its type.

setAttributes

public void setAttributes(Vector attrib)
Set the attributes of this Node with Vector attrib.
Parameters :
attrib - the Vector of attributes to set.
See also :
getAttributes()

setType

public void setType(String type)
Set the type of this Node with type.
Parameters :
type - the String type to set.
See also :
getType()

setValue

public void setValue(String val)
Set the value of this Node with val.
Parameters :
val - the String value to set.
See also :
getValue()

toString

public String toString()
Returns the string representation of this Node.
Overrides :
toString in class Object.
Returns :
a String representation of this object.

Submit a bug or feature
Copyright 2000 INRIA Rhone-Alpes, Zirst - 655 avenue de l'Europe, 38334 Saint Ismier Cedex,
Montbonnot, France. All Rights Reserved.