java.lang.Object | +--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 |
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 |
Vector attributes
String type
Type
is determined when parsing ontology depends if tag encoutered is a class or a relation.String value
Value
is determined when parsing ontology with the value of attribute name
of the tag class or relation.Constructor Detail |
public Node()
Creates a Node
with value = "", type = "", and an empty vector of attributes. Each field is initialized.
public Node(String val, String type, Vector attrib)
Creates a Node
with value = val, type = type, and attributes = attrib.
val
- the value of the node.type
- the type of the node.attrib
- the vector of attributes of the node.Method Detail |
public Vector getAttributes()
Vector
of attributes of this Node
.public static DefaultMutableTreeNode getNode(DefaultMutableTreeNode rootNode, String nameClass)
DefaultMutableTreeNode
which value equals nameClass
from rootNode
parent.rootNode
- the DefaultMutableTreeNode parent.nameClass
- the String class name.public String getType()
Node
, that is to say returns "obj" if Node
is a class and "rel" if Node
is a relation.public String getValue()
Node
, that is to say the class name.public void printNodeInfo()
Node
: the value
, the type
and for each attribute
, its name and its type.public void setAttributes(Vector attrib)
Node
with Vector attrib
.attrib
- the Vector of attributes to set.public void setType(String type)
Node
with type
.type
- the String type to set.public void setValue(String val)
Node
with val
.val
- the String value to set.public String toString()
Node
.