public abstract class AbstractTreeNode extends Object implements TreeNode, Comparable<TreeNode>
Modifier and Type | Field and Description |
---|---|
protected String |
category |
protected Map<String,TreeNode> |
children |
protected String |
description |
protected boolean |
enabled |
protected String |
name |
Constructor and Description |
---|
AbstractTreeNode() |
Modifier and Type | Method and Description |
---|---|
TreeNode |
addChild(TreeNode newChild) |
int |
compareTo(TreeNode other) |
boolean |
equals(Object o) |
String |
getCategory() |
TreeNode |
getChild(String childName) |
Collection<TreeNode> |
getChildNodes()
Returns a mutable view of the children
|
Enumeration<TreeNode> |
getChildNodesImmutable() |
String |
getCompletePathName() |
String |
getDescription() |
Collection<TreeNode> |
getEnabledChildNodes()
Returns a mutable view of the children
|
String |
getName() |
TreeNode |
getNode(String completeName) |
List<TreeNode> |
getNodes(String pattern)
Behaves as {@link #getNodes (String, boolean, boolean) with ignoreDisabled set to true
and gfV2Compatible set to true
Pattern is considered to be a GFV2 Compatible Pattern
|
List<TreeNode> |
getNodes(String pattern,
boolean ignoreDisabled,
boolean gfv2Compatible)
Returns all nodes that match the given Regex pattern as specified by the
Pattern class.
|
TreeNode |
getParent() |
TreeNode |
getPossibleParentNode(String pattern)
Get the "parent" matching the given pattern.
|
Object |
getValue() |
boolean |
hasChildNodes() |
int |
hashCode() |
boolean |
isEnabled() |
void |
removeChild(TreeNode oldChild) |
void |
setCategory(String category) |
void |
setDescription(String description) |
void |
setEnabled(boolean enabled) |
void |
setName(String aname) |
void |
setParent(TreeNode parent) |
String |
toString() |
List<TreeNode> |
traverse(boolean ignoreDisabled)
Returns all the nodes under the current tree
|
protected String name
protected String category
protected String description
protected boolean enabled
public String getName()
getName
in interface TreeElement
public void setName(String aname)
setName
in interface TreeElement
public Object getValue()
getValue
in interface TreeElement
public void setEnabled(boolean enabled)
setEnabled
in interface TreeNode
public String getCompletePathName()
getCompletePathName
in interface TreeNode
public Collection<TreeNode> getChildNodes()
getChildNodes
in interface TreeNode
public Collection<TreeNode> getEnabledChildNodes()
getEnabledChildNodes
in interface TreeNode
public Enumeration<TreeNode> getChildNodesImmutable()
public boolean hasChildNodes()
hasChildNodes
in interface TreeNode
public void removeChild(TreeNode oldChild)
removeChild
in interface TreeNode
public String getCategory()
getCategory
in interface TreeNode
public void setCategory(String category)
setCategory
in interface TreeNode
public String getDescription()
getDescription
in interface TreeNode
public void setDescription(String description)
setDescription
in interface TreeNode
public List<TreeNode> traverse(boolean ignoreDisabled)
public List<TreeNode> getNodes(String pattern, boolean ignoreDisabled, boolean gfv2Compatible)
TreeNode
getNodes
in interface TreeNode
pattern
- Find a node that matches the pattern. By default pattern should follow the conventions
outlined by the java.util.regex.Pattern class.ignoreDisabled
- will ignore a disabled node and its childrengfv2Compatible
- in this mode, * has the same meaning as .* in the Pattern class.
The implementation should consider pattern as a v2 pattern.public List<TreeNode> getNodes(String pattern)
TreeNode
public int compareTo(TreeNode other)
compareTo
in interface Comparable<TreeNode>
public TreeNode getPossibleParentNode(String pattern)
TreeNode
getPossibleParentNode
in interface TreeNode
pattern
- Find a node that matches the pattern. By default pattern should follow the conventions
outlined by the java.util.regex.Pattern class.Copyright © 2019. All rights reserved.