Class BitwiseOperatorTable

  • All Implemented Interfaces:
    JepComponent, OperatorTableI, java.io.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:
    Serialized Form
    • Constructor Detail

      • BitwiseOperatorTable

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

        public BitwiseOperatorTable​(OperatorTable2 oldTable,
                                    java.lang.String powerSymbol,
                                    java.lang.String xorSymbol)
        A decerator constructor. Takes all the operators suplied 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.