|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmulan.data.LabelNodeImpl
public class LabelNodeImpl
Implementation of LabelNode, representing a label attribute and its connection
within a hierarchy of labels.
| Constructor Summary | |
|---|---|
LabelNodeImpl(String name)
Creates a new instance of LabelNodeImpl. |
|
| Method Summary | |
|---|---|
boolean |
addChildNode(LabelNode node)
Adds the specified LabelNode to the set of child nodes. |
boolean |
equals(Object obj)
The two LabelNodeImpl nodes are equal if the are the same
(points to the same object) of if they returns same getName() value. |
Set<LabelNode> |
getChildren()
Gets the unmodifiable Set of child LabelNode of this node, if hierarchy exists. |
Set<String> |
getChildrenLabels()
Gets the children of a label |
Set<String> |
getDescendantLabels()
Gets a Set of the names of descendant LabelNode of this node, if hierarchy exists. |
String |
getName()
Gets the name of the label this node represents. |
LabelNode |
getParent()
Gets the parent LabelNode of this node if hierarchy exists. |
boolean |
hasChildren()
Determines whether the LabelNode has child nodes. |
int |
hashCode()
The hash code is computed based on label name attribute, which defines the identity of the LabelNodeImpl node. |
boolean |
hasParent()
Determines whether the LabelNode has a parent node in a hierarchy. |
boolean |
removeChildNode(LabelNode node)
Removes the specified LabelNode from the set of child nodes. |
protected void |
setParent(LabelNode node)
Sets a node as the parent of this node |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LabelNodeImpl(String name)
LabelNodeImpl.
name - the name of the label attribute this node represents| Method Detail |
|---|
public boolean addChildNode(LabelNode node)
LabelNode to the set of child nodes.
The parent of added node is set to reference this LabelNode instance.
This indicates that there is a hierarchy between these two LabelNode nodes.
node - the LabelNode to be removed
ArgumentNullException - if specified LabelNode parameter is null
IllegalArgumentException - if LabelNode being added has same name as this LabelNode instance (parent)public boolean removeChildNode(LabelNode node)
LabelNode from the set of child nodes.
The connection between removed LabelNode and its LabelNode.getParent()
node - the LabelNode to be removed
ArgumentNullException - if specified LabelNode parameter is nullpublic Set<String> getChildrenLabels()
public Set<String> getDescendantLabels()
LabelNodeSet of the names of descendant LabelNode of this node, if hierarchy exists.
If no descendant nodes exists for this LabelNode, empty Set is returned.
getDescendantLabels in interface LabelNodeSet of child nodespublic Set<LabelNode> getChildren()
LabelNodeSet of child LabelNode of this node, if hierarchy exists.
If no child nodes exists for this LabelNode, empty Set is returned.
getChildren in interface LabelNodeSet of child nodespublic String getName()
LabelNodeLabelNode is determined by the name.
getName in interface LabelNodepublic LabelNode getParent()
LabelNodeLabelNode of this node if hierarchy exists.
If the node has not a parent LabelNode, null is returned.
getParent in interface LabelNodeLabelNode or null if the parent does not exists.protected void setParent(LabelNode node)
node - a node to be set as parentpublic boolean hasChildren()
LabelNodeLabelNode has child nodes.
hasChildren in interface LabelNodetrue if the node has child nodes; false otherwise.public boolean hasParent()
LabelNodeLabelNode has a parent node in a hierarchy.
hasParent in interface LabelNodetrue if the node has parent; false otherwise.public int hashCode()
LabelNodeImpl node.
hashCode in class Objectpublic boolean equals(Object obj)
LabelNodeImpl nodes are equal if the are the same
(points to the same object) of if they returns same getName() value.
The name of the labels gives the identity to the LabelNodeImpl.
equals in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||