public class CriterionHierarchyNode extends Object implements Serializable
criterion and its getChildren().| Constructor and Description |
|---|
CriterionHierarchyNode(Criterion aCriterion)
Builds a new node.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addChild(Criterion aCriterion)
Adds a child to this node if the criterion is not already registered as a child.
|
boolean |
addChild(CriterionHierarchyNode aNode)
Adds a child to this node if its criterion is not already registered as a child.
|
CriterionHierarchyNode |
deepCopy()
Returns a deep copy of this node.
|
CriterionHierarchyNode |
getChild(Criterion aCriterion)
Returns the child node for the supplied criterion.
|
CriterionHierarchyNode |
getChild(String aCriterionID)
Returns the child node with the supplied criterion ID.
|
Set<CriterionHierarchyNode> |
getChildren()
Returns the children of this node.
|
Criterion |
getCriterion()
Returns the criterion attached to this node.
|
boolean |
isLeaf() |
boolean |
removeChild(Criterion aCriterion)
Removes from this node's children the child whose criterion is the one supplied.
|
boolean |
removeChild(CriterionHierarchyNode aChild)
Removes a child from this node's children.
|
String |
toString() |
protected String |
toString(String start,
String end) |
public static final String TAG
public CriterionHierarchyNode(Criterion aCriterion)
aCriterion - the criterion attached to the new nodepublic Criterion getCriterion()
public boolean addChild(CriterionHierarchyNode aNode)
aNode - the node to be addedpublic boolean addChild(Criterion aCriterion)
aNode - the node to be addedpublic boolean removeChild(CriterionHierarchyNode aChild)
aChild - the node to be removed.true if the element was removed, false if it was not in this node's children.public boolean removeChild(Criterion aCriterion)
aChild - the criterion for the node to be removed.true if the corresponding child could be found and removed.public Set<CriterionHierarchyNode> getChildren()
add or remove children from one of the returned set's nodes, this will
directly change the sub-hierarchy held by this node as well. If you want to manipulate the hierarchy of the
returned nodes without affecting this node's hierarchy, call deepCopy() on this object and then call
this method on the copy instead.public CriterionHierarchyNode getChild(Criterion aCriterion)
aCriterion - the criterion to search in this node's childrennull if no such child could be found.public CriterionHierarchyNode getChild(String aCriterionID)
aCriterionID - the ID of a criterion to search in this node's childrennull if no such child could be found.public boolean isLeaf()
public CriterionHierarchyNode deepCopy()
Copyright © 2013–2021 Sébastien Bigaret, Patrick Meyer. All rights reserved.