Package com.jalios.util
Class MockTreeNode
- java.lang.Object
-
- com.jalios.util.MockTreeNode
-
-
Constructor Summary
Constructors Constructor Description MockTreeNode(java.lang.String str)
MockTreeNode(java.lang.String str, TreeNode... child)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(MockTreeNode node)
int
compareTo(java.lang.Object o)
boolean
equals(java.lang.Object o)
java.lang.String
getId()
Returns id of the current nodejava.lang.String
getName()
java.util.Collection<TreeNode>
getTreeChildren()
Returns a Collection of TreeNode children of the current nodeTreeNode
getTreeParent()
Returns parent of the current nodeTreeNode
getTreeRoot()
Returns the root of the current nodeboolean
isTreeLeaf()
Returns boolean true if the TreeNode is a leafboolean
isTreeNode()
Returns boolean true if the TreeNode is a nodejava.lang.String
toString()
-
-
-
Field Detail
-
parent
public TreeNode parent
-
str
public java.lang.String str
-
-
Constructor Detail
-
MockTreeNode
public MockTreeNode(java.lang.String str)
-
MockTreeNode
public MockTreeNode(java.lang.String str, TreeNode... child)
-
-
Method Detail
-
addChild
public void addChild(MockTreeNode node)
-
getName
public java.lang.String getName()
-
getId
public java.lang.String getId()
Description copied from interface:TreeNode
Returns id of the current node
-
getTreeChildren
public java.util.Collection<TreeNode> getTreeChildren()
Description copied from interface:TreeNode
Returns a Collection of TreeNode children of the current node- Specified by:
getTreeChildren
in interfaceTreeNode
- Returns:
- Collection of TreeNode
-
getTreeParent
public TreeNode getTreeParent()
Description copied from interface:TreeNode
Returns parent of the current node- Specified by:
getTreeParent
in interfaceTreeNode
- Returns:
- TreeNode parent Node
-
isTreeLeaf
public boolean isTreeLeaf()
Description copied from interface:TreeNode
Returns boolean true if the TreeNode is a leaf- Specified by:
isTreeLeaf
in interfaceTreeNode
- Returns:
- boolean indicating if node is leaf or node
-
isTreeNode
public boolean isTreeNode()
Description copied from interface:TreeNode
Returns boolean true if the TreeNode is a node- Specified by:
isTreeNode
in interfaceTreeNode
- Returns:
- boolean indicating if node is leaf or node
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
compareTo
public int compareTo(java.lang.Object o)
- Specified by:
compareTo
in interfacejava.lang.Comparable
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
getTreeRoot
public TreeNode getTreeRoot()
Description copied from interface:TreeNode
Returns the root of the current node- Specified by:
getTreeRoot
in interfaceTreeNode
- Returns:
- TreeNode root Node
-
-