Class TreeNode<ValueType>
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.util.TreeNode<ValueType>
-
- Type Parameters:
ValueType
- The value to be stored by this node
public class TreeNode<ValueType> extends java.lang.Object
Simple generic tree node with links to parent and a list of children
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(TreeNode<ValueType> node)
Add a child to the children listvoid
addProperty(java.lang.String key, java.lang.Object value)
Add a property to the tree nodeboolean
equals(java.lang.Object obj)
java.util.Collection<TreeNode<ValueType>>
getChildren()
Get a list of all the children of this nodeTreeNode<ValueType>
getParent()
Get the parent nodejava.util.Map<java.lang.String,java.lang.Object>
getProperties()
ValueType
getValue()
Get the value stored by this nodeint
hashCode()
void
setParent(TreeNode<ValueType> parent)
Set the parent nodevoid
setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
void
setValue(ValueType value)
Set the value for this nodejava.lang.String
toString()
-
-
-
Method Detail
-
getChildren
public java.util.Collection<TreeNode<ValueType>> getChildren()
Get a list of all the children of this node- Returns:
- A List of child nodes.
-
addChild
public void addChild(TreeNode<ValueType> node)
Add a child to the children list- Parameters:
node
- The child to add
-
getValue
public ValueType getValue()
Get the value stored by this node- Returns:
- the value stored by this node
-
setValue
public void setValue(ValueType value)
Set the value for this node- Parameters:
value
- the value for this node
-
setParent
public void setParent(TreeNode<ValueType> parent)
Set the parent node- Parameters:
parent
- the parent node
-
getProperties
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
-
setProperties
public void setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
-
addProperty
public void addProperty(java.lang.String key, java.lang.Object value)
Add a property to the tree node- Parameters:
key
- key for the propertyvalue
- value of the property
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-