API Docs for: 1.0

Class Operand

Extends: StackEl
Class defined in: src/js/stackEl.js:60

This class defines the operand elements of the model stack (containing Ord objects or natural numbers as values).

Ord getOrd( )
src/js/stackEl.js:91

Get the value of this Stack Element as an instance of the class

Ord
.


Returns: <Ord> The value of this stack element
Number getType( )
Defined in StackEl: src/js/stackEl.js:34

Get the type of this Stack Element.


Returns: <Number> The type. A value form model.enumType.
Number / Ord getValue( )
src/js/stackEl.js:116

Get the value of this operand, either as javascript number object (if this.t == enumType.tNatNum) or as string (if this.t === tConst) or as Ord object (if the value contains such an object). May throw a ClassedError.


Returns: <Number / Ord> The value contained in this Operand element.
Boolean isValueSet( )
src/js/stackEl.js:173

Checks if there is a value set for this Operand.


Returns: <Boolean> True if a value is set
serialize( arr, htmlStyle. )
Defined in StackEl but overwritten locally: src/js/stackEl.js:182

Serializes the data of this Operand and appends the single components to the array given as parameter

Parameters:
  • arr <Array>

    The Array to which the data will be appended.

  • htmlStyle. <Boolean>

    If true, the serialization generates a html representation.

setValue( val )
src/js/stackEl.js:141

Set the value of this Operand element. May throw a ClassedError.

Parameters:
  • val <Number / Ord>

    The value to set. Its type must correspond to the defined type of this Operand

t <number (Value from model.enumType)>
src/js/stackEl.js:25

Type of StackElement

v <Ord / string>
src/js/stackEl.js:72

The value of the operand. Contains either an object of type Ord (if t == tOrd) or a String representing the value of a natural number or a constant (if t == tNatNum or t === tConst respectively)