public final class BinaryTreeNodeImpl<E> extends NonSettableNode<E,BinaryTreeNode<E>> implements BinaryTreeNode<E>
Modifier and Type | Class and Description |
---|---|
static class |
BinaryTreeNodeImpl.BinaryTreeConstructor<E> |
static class |
BinaryTreeNodeImpl.EmptyConstructor<E> |
element
Constructor and Description |
---|
BinaryTreeNodeImpl(E element) |
BinaryTreeNodeImpl(E element,
BinaryTreeNodeImpl<E> left,
BinaryTreeNodeImpl<E> right) |
Modifier and Type | Method and Description |
---|---|
Iterator<BinaryTreeNodeImpl<E>> |
childIterator() |
Iterator<BinaryTreeNodeImpl<E>> |
childStructuralIterator()
An iterator over the structure of the children.
|
BinaryTreeNodeImpl<E> |
getChild(int nChild)
Get the nth child node.
|
BinaryTreeNodeImpl<E> |
getLeft() |
int |
getNumberOfChildren() |
BinaryTreeNodeImpl<E> |
getRight() |
boolean |
isLeaf() |
static <E> TypeKey<BinaryTree<E,BinaryTreeNode<E>>> |
typeKey() |
getElement
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getElement, getElementClass
public BinaryTreeNodeImpl(E element)
public BinaryTreeNodeImpl(E element, BinaryTreeNodeImpl<E> left, BinaryTreeNodeImpl<E> right)
public BinaryTreeNodeImpl<E> getLeft()
getLeft
in interface OpenBinaryTreeNode<E,BinaryTreeNode<E>>
public BinaryTreeNodeImpl<E> getRight()
getRight
in interface OpenBinaryTreeNode<E,BinaryTreeNode<E>>
public int getNumberOfChildren()
getNumberOfChildren
in interface OpenNode<E,BinaryTreeNode<E>>
public Iterator<BinaryTreeNodeImpl<E>> childIterator()
childIterator
in interface OpenNode<E,BinaryTreeNode<E>>
public Iterator<BinaryTreeNodeImpl<E>> childStructuralIterator()
OpenStructuralNode
childStructuralIterator
in interface OpenStructuralNode<E,BinaryTreeNode<E>>
public BinaryTreeNodeImpl<E> getChild(int nChild)
OpenStructuralNode
getChild
in interface OpenStructuralNode<E,BinaryTreeNode<E>>
nChild
- The nth valuepublic boolean isLeaf()
isLeaf
in interface OpenNode<E,BinaryTreeNode<E>>
true
if the node is a leaf nodepublic static <E> TypeKey<BinaryTree<E,BinaryTreeNode<E>>> typeKey()
Copyright © 2014–2016. All rights reserved.