Package ubic.basecode.dataStructure.tree
Class BinaryTreeNode<T>
- java.lang.Object
-
- ubic.basecode.dataStructure.Visitable
-
- ubic.basecode.dataStructure.tree.BinaryTreeNode<T>
-
public class BinaryTreeNode<T> extends Visitable
- Author:
- pavlidis
-
-
Constructor Summary
Constructors Constructor Description BinaryTreeNode()BinaryTreeNode(T contents)BinaryTreeNode(BinaryTreeNode<T> parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetContents()BinaryTreeNode<T>getLeft()BinaryTreeNode<T>getRight()BinaryTreeNode<T>insertLeft(T c)BinaryTreeNode<T>insertRight(T c)booleanisLeaf()booleanisRoot()voidsetContents(T contents)voidsetLeft(BinaryTreeNode<T> left)voidsetRight(BinaryTreeNode<T> right)
-
-
-
Constructor Detail
-
BinaryTreeNode
public BinaryTreeNode()
-
BinaryTreeNode
public BinaryTreeNode(BinaryTreeNode<T> parent)
-
BinaryTreeNode
public BinaryTreeNode(T contents)
- Parameters:
left-right-contents-
-
-
Method Detail
-
getContents
public Object getContents()
- Returns:
-
getLeft
public BinaryTreeNode<T> getLeft()
- Returns:
-
getRight
public BinaryTreeNode<T> getRight()
- Returns:
-
insertLeft
public BinaryTreeNode<T> insertLeft(T c)
-
insertRight
public BinaryTreeNode<T> insertRight(T c)
-
isLeaf
public boolean isLeaf()
- Returns:
-
isRoot
public boolean isRoot()
- Returns:
-
setContents
public void setContents(T contents)
- Parameters:
contents-
-
setLeft
public void setLeft(BinaryTreeNode<T> left)
- Parameters:
left-
-
setRight
public void setRight(BinaryTreeNode<T> right)
- Parameters:
right-
-
-