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

Node representing a symbolic parameter, e.g., a varibale. More...

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

Public Member Functions

 Symbol (String name)
 create number More...
 
String getName ()
 get symbol's name More...
 
double getValue ()
 get value More...
 
Type getType ()
 Get type identifier. More...
 
Symbol 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

Node representing a symbolic parameter, e.g., a varibale.

See also
ExpressionTree

Definition at line 6 of file Symbol.java.

Constructor & Destructor Documentation

◆ Symbol()

create number

Definition at line 11 of file Symbol.java.

11{ name_=name; }

Member Function Documentation

◆ clone()

Symbol aud.example.expr.Symbol.clone ( )

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

Reimplemented from aud.example.expr.AtomicExpression.

Definition at line 21 of file Symbol.java.

21{ return new Symbol(name_); }
Symbol(String name)
create number
Definition: Symbol.java:11

◆ getName()

String aud.example.expr.Symbol.getName ( )

get symbol's name

Definition at line 14 of file Symbol.java.

14{ return name_; }

◆ getType()

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

Get type identifier.

Reimplemented from aud.example.expr.AtomicExpression.

Definition at line 20 of file Symbol.java.

20{ return Type.TSymbol; }

References aud.example.expr.AtomicExpression.Type.TSymbol.

◆ getValue()

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

get value

Exceptions
UnsupportedOperationExceptionif value cannot be determined

Reimplemented from aud.example.expr.AtomicExpression.

Definition at line 16 of file Symbol.java.

16 {
17 throw new UnsupportedOperationException
18 ("don't know value of '"+name_+"'");
19 }

◆ toString()

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

Definition at line 22 of file Symbol.java.

22{ return name_; }

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