Class LambdaOperatorTable

All Implemented Interfaces:
JepComponent, OperatorTableI, Serializable
Direct Known Subclasses:
ChainedOperatorTable

public class LambdaOperatorTable extends StandardOperatorTable2
An OperatorTable that defines the lambda definition operator x => x^2, the optional range operator [1..5], the optinal send to operator x^2 -> y, and optional ternary operator code ? x : y. The main symbols used are defined in the constructor, the symbols list brackets and ternary operators are set in the properties file.
Since:
Jep 4.1 extensions 2.2
See Also:
  • Constructor Details

    • LambdaOperatorTable

      public LambdaOperatorTable(String lambdaDefSymbol, String rangeSymbol, String sendToSymbol, boolean hasTernary)
      Constructor with specified symbols. Defining the lambda definition operator x => x^2 the range operator [1..5] the send to operator x^2 -> y and whether the ternary operator code ? x : y is defined. The symbols list brackets and ternary operators are set in the properties file.
      Parameters:
      lambdaDefSymbol - string used to represent lambda definition operator, typically =>.
      rangeSymbol - string used to represent range operator, typically ... If null then no range operator is added.
      sendToSymbol - string used to represent send to operator, typically ->. If null then no send to operator is added.
      hasTernary - if true then a ternary conditional operator is added with symbol "cond ? :"
    • LambdaOperatorTable

      public LambdaOperatorTable(String lambdaDefSymbol, String rangeSymbol, String sendToSymbol, boolean hasTernary, FieldI field)
      Constructor with specified symbols using a given field. Defining the lambda definition operator x => x^2 the range operator [1..5] the send to operator x^2 -> y and whether the ternary operator code ? x : y is defined. The symbols list brackets and ternary operators are set in the properties file.
      Parameters:
      lambdaDefSymbol - string used to represent lambda definition operator, typically =>.
      rangeSymbol - string used to represent range operator, typically ... If null then no range operator is added.
      sendToSymbol - string used to represent send to operator, typically ->. If null then no send to operator is added.
      hasTernary - if true then a ternary conditional operator is added with symbol "cond ? :"
      field - the field to use for the range operator. If null then a default LambdaRange is used.
    • LambdaOperatorTable

      public LambdaOperatorTable(OperatorTable2 oldTable, String lambdaDefSymbol, String rangeSymbol, String sendToSymbol, boolean hasTernary)
      A decorator constructor. Takes all the operators supplied in the oldTable and add extra bitwise operations.
      Parameters:
      oldTable - table with most operators.
      lambdaDefSymbol - string used to represent lambda definition operator, typically =>.
      rangeSymbol - string used to represent range operator, typically ... If null then no range operator is added.
      sendToSymbol - string used to represent send to operator, typically ->. If null then no send to operator is added.
      hasTernary - if true then a ternary conditional operator is added with symbol "cond ? :"
    • LambdaOperatorTable

      protected LambdaOperatorTable(Map<EmptyOperatorTable.OperatorKey,Operator> map)
    • LambdaOperatorTable

      public LambdaOperatorTable(OperatorTable2 oldTable, String lambdaDefSymbol, String rangeSymbol, String sendToSymbol, boolean hasTernary, FieldI field)
      A decorator constructor with a specified field. Takes all the operators supplied in the oldTable and add extra bitwise operations.
      Parameters:
      oldTable - table with most operators.
      lambdaDefSymbol - string used to represent lambda definition operator, typically =>.
      rangeSymbol - string used to represent range operator, typically ... If null then no range operator is added.
      sendToSymbol - string used to represent send to operator, typically ->. If null then no send to operator is added.
      hasTernary - if true then a ternary conditional operator is added with symbol "cond ? :"
      field - the field to use for the range operator. If null then a default LambdaRange is used.
  • Method Details