Class BitwiseOperatorTable

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

public class BitwiseOperatorTable extends StandardOperatorTable2

An operator table with a selection of bitwise operators.

  • And: a & b
  • Or: a | b
  • Complement: ~a
  • Xor: a ^ b
  • Left shift: a >> b
  • Right shift: a << b
  • Right shift with zero extension: a <<< b

The BitwiseOperatorTable can be used as a drop in replacement for the StandardOperatorTable.

jep.setComponent(new BitwiseOperatorTable("**","^"));

Note the standard symbol used for power ^ conflicts with java's symbol used for xor, the constructor for the BitwiseOperatorTable takes two strings specifying the symbols used for power and xor respectively.

Author:
Richard Morris
See Also:
  • Constructor Details

    • BitwiseOperatorTable

      public BitwiseOperatorTable(String powerSymbol, String xorSymbol)
      Standard constructor.
      Parameters:
      powerSymbol - string used to represent power.
      xorSymbol - string used to represent xor.
    • BitwiseOperatorTable

      public BitwiseOperatorTable(OperatorTable2 oldTable, String powerSymbol, String xorSymbol)
      A decorator constructor. Takes all the operators supplied in the oldTable and add extra bitwise operations.
      Parameters:
      oldTable - table with most operators.
      powerSymbol - string used to represent power.
      xorSymbol - string used to represent xor.
    • BitwiseOperatorTable

      protected BitwiseOperatorTable(Map<EmptyOperatorTable.OperatorKey,Operator> map)
  • Method Details