AuD
Lecture 'Algorithmen und Datenstrukturen' (code examples)
aud.example.expr.Times Class Reference

binary * operator: A*B More...

+ Inheritance diagram for aud.example.expr.Times:
+ Collaboration diagram for aud.example.expr.Times:

Public Member Functions

 Times ()
 create operation More...
 
double getValue ()
 get value More...
 
Type getType ()
 Get type identifier. More...
 
Times clone ()
 Get a copy: a new AtomicExpression of same type/content. More...
 
String toString ()
 
- Public Member Functions inherited from aud.example.expr.AtomicExpression
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...
 

Additional Inherited Members

- Protected Attributes inherited from aud.example.expr.AtomicExpression
ExpressionTree node_ = null
 uplink reference to node: node_.getData()==this @endiliteral
More...
 

Detailed Description

binary * operator: A*B

Definition at line 4 of file Times.java.

Constructor & Destructor Documentation

◆ Times()

create operation

Definition at line 6 of file Times.java.

6{}

Referenced by aud.example.expr.Times.clone().

+ Here is the caller graph for this function:

Member Function Documentation

◆ clone()

Times aud.example.expr.Times.clone ( )

Get a copy: a new AtomicExpression of same type/content.

Reimplemented from aud.example.expr.AtomicExpression.

Definition at line 15 of file Times.java.

15{ return new Times(); }
Times()
create operation
Definition: Times.java:6

References aud.example.expr.Times.Times().

+ Here is the call graph for this function:

◆ getType()

Type aud.example.expr.Times.getType ( )

Get type identifier.

Reimplemented from aud.example.expr.AtomicExpression.

Definition at line 14 of file Times.java.

14{ return Type.OpTimes; }

References aud.example.expr.AtomicExpression.Type.OpTimes.

◆ getValue()

double aud.example.expr.Times.getValue ( )

get value

Exceptions
UnsupportedOperationExceptionif value cannot be determined

Reimplemented from aud.example.expr.AtomicExpression.

Definition at line 8 of file Times.java.

8 {
9 ExpressionTree left =(ExpressionTree) node_.getLeft();
10 ExpressionTree right=(ExpressionTree) node_.getRight();
11 return
12 left.getData().getValue() * right.getData().getValue();
13 }
BinaryTree< T > getLeft()
get left child or null
Definition: BinaryTree.java:86
BinaryTree< T > getRight()
get right child or null)
Definition: BinaryTree.java:88
ExpressionTree node_
uplink reference to node: node_.getData()==this @endiliteral

References aud.BinaryTree< T >.getData(), aud.BinaryTree< T >.getLeft(), aud.BinaryTree< T >.getRight(), and aud.example.expr.AtomicExpression.node_.

+ Here is the call graph for this function:

◆ toString()

String aud.example.expr.Times.toString ( )

Definition at line 16 of file Times.java.

16{ return "*"; }

The documentation for this class was generated from the following file: