![]() |
AuD
Lecture 'Algorithmen und Datenstrukturen' (code examples)
|
Superclass for data associated with a tree node. More...
Classes | |
enum | Type |
type identifiers returned by getType More... | |
Public Member Functions | |
boolean | isOperator () |
node represents operator More... | |
boolean | isTerminal () |
node represents number or symbol More... | |
abstract Type | getType () |
Get type identifier. More... | |
AtomicExpression | clone () |
Get a copy: a new AtomicExpression of same type/content. More... | |
abstract double | getValue () |
get value More... | |
Protected Attributes | |
ExpressionTree | node_ = null |
uplink reference to node: node_.getData()==this @endiliteral More... | |
Superclass for data associated with a tree node.
Definition at line 6 of file AtomicExpression.java.
AtomicExpression aud.example.expr.AtomicExpression.clone | ( | ) |
Get a copy: a new AtomicExpression of same type/content.
Reimplemented in aud.example.expr.Divide, aud.example.expr.Minus, aud.example.expr.Number, aud.example.expr.Plus, aud.example.expr.Power, aud.example.expr.Symbol, aud.example.expr.Times, and aud.example.expr.UnaryMinus.
Definition at line 29 of file AtomicExpression.java.
|
abstract |
Get type identifier.
Reimplemented in aud.example.expr.Divide, aud.example.expr.Minus, aud.example.expr.Number, aud.example.expr.Plus, aud.example.expr.Power, aud.example.expr.Symbol, aud.example.expr.Times, and aud.example.expr.UnaryMinus.
|
abstract |
get value
UnsupportedOperationException | if value cannot be determined |
Reimplemented in aud.example.expr.Divide, aud.example.expr.Minus, aud.example.expr.Number, aud.example.expr.Plus, aud.example.expr.Power, aud.example.expr.Symbol, aud.example.expr.Times, and aud.example.expr.UnaryMinus.
boolean aud.example.expr.AtomicExpression.isOperator | ( | ) |
node represents operator
Definition at line 16 of file AtomicExpression.java.
References aud.example.expr.AtomicExpression.isTerminal().
boolean aud.example.expr.AtomicExpression.isTerminal | ( | ) |
node represents number or symbol
Definition at line 18 of file AtomicExpression.java.
References aud.BinaryTree< T >.isLeaf(), and aud.example.expr.AtomicExpression.node_.
Referenced by aud.example.expr.AtomicExpression.isOperator().
|
protected |
uplink reference to node: node_.getData()==this @endiliteral
Set by constructor of ExpressionTree
. This is not good style but alllows for reusing aud.BinaryTree
as is.
Definition at line 13 of file AtomicExpression.java.
Referenced by aud.example.expr.ExpressionTree.ExpressionTree(), aud.example.expr.Divide.getValue(), aud.example.expr.Minus.getValue(), aud.example.expr.Plus.getValue(), aud.example.expr.Power.getValue(), aud.example.expr.Times.getValue(), aud.example.expr.UnaryMinus.getValue(), aud.example.expr.AtomicExpression.isTerminal(), and aud.example.expr.ExpressionTree.setData().