Class AbstractTreeNode
- java.lang.Object
-
- org.glassfish.flashlight.datatree.impl.AbstractTreeNode
-
- All Implemented Interfaces:
Comparable<TreeNode>,TreeElement,TreeNode
- Direct Known Subclasses:
AverageImpl,CounterImpl,MethodInvokerImpl,TimeStatsAbstractImpl,TreeNodeImpl
public abstract class AbstractTreeNode extends Object implements TreeNode, Comparable<TreeNode>
- Author:
- Harpreet Singh, Byron Nevins 12/18/2010 -- Added encode/decode. Note that the encoded form for a dot is NOT something like "\\." -- there is too much code around making assumptions about dots, splitting strings, etc. So we replace with ___MONDOT___
-
-
Constructor Summary
Constructors Constructor Description AbstractTreeNode()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TreeNodeaddChild(TreeNode newChild)intcompareTo(TreeNode other)booleanequals(Object o)StringgetCategory()TreeNodegetChild(String childName)Collection<TreeNode>getChildNodes()Returns a mutable view of the childrenEnumeration<TreeNode>getChildNodesImmutable()StringgetCompletePathName()StringgetDescription()Collection<TreeNode>getEnabledChildNodes()Returns a mutable view of the childrenStringgetName()TreeNodegetNode(String completeName)List<TreeNode>getNodes(String 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.TreeNodegetParent()TreeNodegetPossibleParentNode(String pattern)Get the "parent" matching the given pattern.ObjectgetValue()booleanhasChildNodes()inthashCode()booleanisEnabled()voidremoveChild(TreeNode oldChild)voidsetCategory(String category)voidsetDescription(String description)voidsetEnabled(boolean enabled)voidsetName(String aname)voidsetParent(TreeNode parent)StringtoString()List<TreeNode>traverse(boolean ignoreDisabled)Returns all the nodes under the current tree
-
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein interfaceTreeElement
-
setName
public void setName(String aname)
- Specified by:
setNamein interfaceTreeElement
-
getValue
public Object getValue()
- Specified by:
getValuein interfaceTreeElement
-
setEnabled
public void setEnabled(boolean enabled)
- Specified by:
setEnabledin interfaceTreeNode
-
getCompletePathName
public String getCompletePathName()
- Specified by:
getCompletePathNamein interfaceTreeNode- Returns:
- complete dotted name to this node
-
getChildNodes
public Collection<TreeNode> getChildNodes()
Returns a mutable view of the children- Specified by:
getChildNodesin interfaceTreeNode- Returns:
-
getEnabledChildNodes
public Collection<TreeNode> getEnabledChildNodes()
Returns a mutable view of the children- Specified by:
getEnabledChildNodesin interfaceTreeNode- Returns:
-
getChildNodesImmutable
public Enumeration<TreeNode> getChildNodesImmutable()
-
hasChildNodes
public boolean hasChildNodes()
- Specified by:
hasChildNodesin interfaceTreeNode
-
removeChild
public void removeChild(TreeNode oldChild)
- Specified by:
removeChildin interfaceTreeNode
-
getCategory
public String getCategory()
- Specified by:
getCategoryin interfaceTreeNode
-
setCategory
public void setCategory(String category)
- Specified by:
setCategoryin interfaceTreeNode
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceTreeNode
-
setDescription
public void setDescription(String description)
- Specified by:
setDescriptionin interfaceTreeNode
-
traverse
public List<TreeNode> traverse(boolean ignoreDisabled)
Returns all the nodes under the current tree
-
getNodes
public List<TreeNode> getNodes(String pattern, boolean ignoreDisabled, boolean gfv2Compatible)
Description copied from interface:TreeNodeReturns all nodes that match the given Regex pattern as specified by the Pattern class. Admin CLI in GlassFish v2 did not use Pattern's specified in java.util.Pattern. It had a simpler mechanism where * was equivalent to .* from Pattern If the V2Compatible flag is turned on, then the pattern is considered a v2 pattern.- Specified by:
getNodesin interfaceTreeNode- Parameters:
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.- Returns:
-
getNodes
public List<TreeNode> getNodes(String pattern)
Description copied from interface:TreeNode
-
compareTo
public int compareTo(TreeNode other)
- Specified by:
compareToin interfaceComparable<TreeNode>
-
getPossibleParentNode
public TreeNode getPossibleParentNode(String pattern)
Description copied from interface:TreeNodeGet the "parent" matching the given pattern. E.g "server.jvm.memory.maxheapsize-count" is the parent of "server.jvm.memory.maxheapsize-count-count" Note that in V3 the latter will NOT be found with getNodes()- Specified by:
getPossibleParentNodein interfaceTreeNode- Parameters:
pattern- Find a node that matches the pattern. By default pattern should follow the conventions outlined by the java.util.regex.Pattern class.- Returns:
- The parent node if found otherwise null.
-
-