API Docs for: 1.0

Class Operator

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

An Operator represents the symbol of a mathematical operator.

Operator( symbol )
src/js/stackEl.js:207
Parameters:
  • symbol <String>

    The character representing the operator. Might be a '^' (exponentiation), '*' (multiplication) or a '+' (Addition).

Number getPrio( )
src/js/stackEl.js:254

Get the priority of this Operator. A higher value means a higher priority in calculation.


Returns: <Number> The priority
String getSymbol( )
src/js/stackEl.js:268

Get the symbol of the operator.


Returns: <String> The symbol
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.
serialize( arr, htmlStyle. )
Defined in StackEl but overwritten locally: src/js/stackEl.js:277

Serializes the data of this Operator and appends the (only) component, the symbol, 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.

prioDef <Object literal containing pairs of string-int (key-value)>
src/js/stackEl.js:240

Defines the priority of the mathematical operators. The operator symbols are the keys, the priority (number) are the values. A higher value means a higher priority in calculation.

sym <String>
src/js/stackEl.js:219

The symbol of the mathematical operator. Possible values are contained in model.Operator.prioDef object.

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

Type of StackElement