Package com.singularsys.jep.misc.javaops

# Class JavaOperatorTable

java.lang.Object
com.singularsys.jep.EmptyOperatorTable
com.singularsys.jep.OperatorTable2
com.singularsys.jep.standard.StandardOperatorTable2
com.singularsys.jep.misc.bitwise.BitwiseOperatorTable
com.singularsys.jep.misc.javaops.JavaOperatorTable

All Implemented Interfaces:
  `JepComponent`, `OperatorTableI`, `Serializable`

public class JavaOperatorTable extends BitwiseOperatorTable

An operator table which supports most of the operators which appear in Java. Includes ++x, x++, a?b:c, x+=y etc. and bitwise operators.

The full set added is: `a&b`, `a|b`, `~a`, `a^b`, `a>>b`, `a<<b` `a<<<b`, `x?y:z`, `++x`, `--x`, `x++`, `x--`, `x+=y`, `x-=y`, `x*=y`, `x/=y`, `x%=y`, `x&=y`, `x|=y`, `x^=y`, `x<<=y`, `x>>=y`, `x<<<=y`.

Author:
  Richard Morris
See Also:
  - Serialized Form

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `JavaOperatorTable.JavaOperators`
  Keys to identify the Java operators.

  ## Nested classes/interfaces inherited from class com.singularsys.jep.misc.bitwise.BitwiseOperatorTable

  `BitwiseOperatorTable.BitwiseOperators`

  ## Nested classes/interfaces inherited from class com.singularsys.jep.OperatorTable2

  `OperatorTable2.BasicOperators, OperatorTable2.PsudoOperators, OperatorTable2.SpecialOperators`

  ## Nested classes/interfaces inherited from class com.singularsys.jep.EmptyOperatorTable

  `EmptyOperatorTable.OperatorKey`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  ``
  `JavaOperatorTable()`
  A JavaOperatorTable with power represented as ** and xor as ^.
  ``
  `JavaOperatorTable(OperatorTable2 oldTable, String powerSymbol, String xorSymbol)`
  A decorator constructor.
  ``
  `JavaOperatorTable(String powerSymbol)`
  A JavaOperatorTable with xor represented as ^ and power as the argument.
  ``
  `JavaOperatorTable(String powerSymbol, String xorSymbol)`
  A JavaOperatorTable with power and xor represented by the arguments
  `protected`
  `JavaOperatorTable(Map<EmptyOperatorTable.OperatorKey,Operator> map)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `addJavaOps()`
  `Operator`
  `getAndEquals()`
  `Operator`
  `getDivideEquals()`
  `Operator`
  `getLShiftEquals()`
  `Operator`
  `getMinusEquals()`
  `Operator`
  `getModEquals()`
  `Operator`
  `getOrEquals()`
  `Operator`
  `getPlusEquals()`
  `Operator`
  `getPostDec()`
  `Operator`
  `getPostInc()`
  `Operator`
  `getPreDec()`
  `Operator`
  `getPreInc()`
  `Operator`
  `getRShiftEquals()`
  `TernaryOperator`
  `getTernCond()`
  `Operator`
  `getTimesEquals()`
  `Operator`
  `getURShiftEquals()`
  `Operator`
  `getXOrEquals()`
  `protected void`
  `setJavaPfmcs()`
  `OperatorTableI`
  `shallowCopy()`
  Create a new version of this OperatorTable.

  ### Methods inherited from class com.singularsys.jep.misc.bitwise.BitwiseOperatorTable

  `addBitOperators, getBitAnd, getBitComp, getBitOr, getBitXor, getLShift, getRShift, getURShift, setBasicPfmcs, setBitPfmcs, setPsudoPfmcs, setSpecialPfmcs`

  ### Methods inherited from class com.singularsys.jep.OperatorTable2

  `getAdd, getAnd, getAssign, getCross, getDivide, getDot, getEle, getEQ, getGE, getGT, getLE, getList, getLT, getMod, getMultiply, getNE, getNop, getNot, getOr, getPower, getRange, getSubtract, getUDivide, getUMinus, getUPlus`

  ### Methods inherited from class com.singularsys.jep.EmptyOperatorTable

  `addOperator, addOperator, addOperator, appendOperator, appendOperator, entrySet, getAllOperatorsByName, getKey, getKeys, getLightWeightInstance, getNumOps, getOperator, getOperatorByName, getOperatorMap, getOperators, getOperatorsByName, getOperatorsBySymbol, init, insertOperator, insertOperator, keySet, removeOperator, removeOperator, replaceOperator, replaceOperator, setBinaryInverseOp, setDistributiveOver, setGroupOperatorRelations, setGroupOperatorRelations, setInverseOp, setPrecedenceTable, setRootOp, setStandardOperatorRelations, threadSafeMapCopy, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### JavaOperatorTable

    public JavaOperatorTable()
    A JavaOperatorTable with power represented as ** and xor as ^.

  - ### JavaOperatorTable

    public JavaOperatorTable(String powerSymbol)
    A JavaOperatorTable with xor represented as ^ and power as the argument.
    Parameters:
      `powerSymbol` - sequence used to represent power.

  - ### JavaOperatorTable

    public JavaOperatorTable(String powerSymbol, String xorSymbol)
    A JavaOperatorTable with power and xor represented by the arguments
    Parameters:
      `powerSymbol` - string used to represent power.
      `xorSymbol` - string used to represent xor.

  - ### JavaOperatorTable

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

  - ### JavaOperatorTable

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

- ## Method Details

  - ### addJavaOps

    protected void addJavaOps()

  - ### setJavaPfmcs

    protected void setJavaPfmcs()

  - ### getPreInc

    public Operator getPreInc()

  - ### getPreDec

    public Operator getPreDec()

  - ### getPostInc

    public Operator getPostInc()

  - ### getPostDec

    public Operator getPostDec()

  - ### getTernCond

    public TernaryOperator getTernCond()

  - ### getPlusEquals

    public Operator getPlusEquals()

  - ### getMinusEquals

    public Operator getMinusEquals()

  - ### getTimesEquals

    public Operator getTimesEquals()

  - ### getDivideEquals

    public Operator getDivideEquals()

  - ### getModEquals

    public Operator getModEquals()

  - ### getAndEquals

    public Operator getAndEquals()

  - ### getOrEquals

    public Operator getOrEquals()

  - ### getXOrEquals

    public Operator getXOrEquals()

  - ### getLShiftEquals

    public Operator getLShiftEquals()

  - ### getRShiftEquals

    public Operator getRShiftEquals()

  - ### getURShiftEquals

    public Operator getURShiftEquals()

  - ### shallowCopy

    public OperatorTableI shallowCopy()
    Description copied from class: `EmptyOperatorTable`
    Create a new version of this OperatorTable. Operators are copied into new table. However, Operators whose pfmc implement JepComponent are duplicated. This means the table could be used in a separate thread without problem. Subclasses should override with method to return a table of the correct type, a typical implementation would be

        @Override
        public OperatorTableI shallowCopy() {
            Map<OperatorKey, Operator> map = this.threadSafeMapCopy();
            return new MyOperatorTable(map);
        }

    using the `EmptyOperatorTable.threadSafeMapCopy()` method to return a copy of the map of operators and a constructor taking this map which uses the `EmptyOperatorTable(Map)` constructor.
    Specified by:
      `shallowCopy` in interface `OperatorTableI`
    Overrides:
      `shallowCopy` in class `BitwiseOperatorTable`
    Returns:
      a new Table