org.grinvin.engine.apengine

Class LabeledBinaryTree

Implemented Interfaces:
Cloneable

public class LabeledBinaryTree
extends BinaryTree

A binary tree that can be labeled.

Field Summary

Operators.Operator[]
operators

Fields inherited from class org.grinvin.engine.apengine.BinaryTree

binaryCount, contents, firstfreepos, unaryCount

Constructor Summary

LabeledBinaryTree(int unaryOperators, int binaryOperators)

Method Summary

LabeledBinaryTree
clone()
void
labelNode(int pos, Operators.Operator op)
Label the node at position pos with Operators.Operator op.
protected String
toString(int parent)

Methods inherited from class org.grinvin.engine.apengine.BinaryTree

childCount, children, clone, extendOn, getBinaryCount, getNodeCount, getUnaryCount, hasLeftChild, hasRightChild, leftChild, newLeftChild, newRightChild, nodesonlevel, removeLeftChild, removeOn, removeRightChild, rightChild, toString, toString

Field Details

operators

public Operators.Operator[] operators

Constructor Details

LabeledBinaryTree

public LabeledBinaryTree(int unaryOperators,
                         int binaryOperators)

Method Details

clone

public LabeledBinaryTree clone()
Overrides:
clone in interface BinaryTree

labelNode

public final void labelNode(int pos,
                            Operators.Operator op)
Label the node at position pos with Operators.Operator op.

toString

protected String toString(int parent)
Overrides:
toString in interface BinaryTree