API Docs for: 1.0

Class Bracket

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

This class defines the bracket elements (representing opening and closing brackets) of the model stack.

Bracket( symbol )
src/js/stackEl.js:295
Parameters:
  • symbol <String>

    May be a '(' or a ')' for left or right bracket respectively.

String getSymbol( )
src/js/stackEl.js:344

Get the string representation of the bracket.


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.
Boolean isLeft( )
src/js/stackEl.js:326

Checks if this bracket is a left (opening) bracket


Returns: <Boolean> True, if this Bracket object contains a left bracket.
Boolean isRight( )
src/js/stackEl.js:335

Checks if this bracket is a right (closing) bracket


Returns: <Boolean> True, if this Bracket object contains a right bracket.
serialize( arr, htmlStyle. )
Defined in StackEl but overwritten locally: src/js/stackEl.js:353

Serializes the data of this Bracket 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.

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

The symbol of the bracket repesenting as sting. Possible values are '(' and ')'.

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

Type of StackElement