|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mulan.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 representsMethod 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()
LabelNode
Set
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 LabelNode
Set
of child nodespublic Set<LabelNode> getChildren()
LabelNode
Set
of child LabelNode
of this node, if hierarchy exists.
If no child nodes exists for this LabelNode
, empty Set
is returned.
getChildren
in interface LabelNode
Set
of child nodespublic String getName()
LabelNode
LabelNode
is determined by the name.
getName
in interface LabelNode
public LabelNode getParent()
LabelNode
LabelNode
of this node if hierarchy exists.
If the node has not a parent LabelNode
, null
is returned.
getParent
in interface LabelNode
LabelNode
or null
if the parent does not exists.protected void setParent(LabelNode node)
node
- a node to be set as parentpublic boolean hasChildren()
LabelNode
LabelNode
has child nodes.
hasChildren
in interface LabelNode
true
if the node has child nodes; false
otherwise.public boolean hasParent()
LabelNode
LabelNode
has a parent node in a hierarchy.
hasParent
in interface LabelNode
true
if the node has parent; false
otherwise.public int hashCode()
LabelNodeImpl
node.
hashCode
in class Object
public 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 |