org.nfunk.jep
Class OperatorSet

java.lang.Object
  extended by org.nfunk.jep.OperatorSet
Direct Known Subclasses:
GOperatorSet, VOperatorSet, XOperatorSet

public class OperatorSet
extends java.lang.Object

The standard set of operators used in JEP.

This creates instances of the PostfixMathCommands for each operator, saving the need for multiple objects to be created. To get a reference to a particular operator use

 OperatorSet opSet = jep.getOperatorSet();
 Operator myOp = opSet.getAdd();
 

If a new operator ABC is added to the parser the this class should be extended to include a method Operator getABC().

Sub classes can change which Operator is returned by each method.

Author:
Rich Morris Created on 19-Oct-2003

Field Summary
protected  Operator OP_ADD
           
protected  Operator OP_AND
           
protected  Operator OP_ASSIGN
           
protected  Operator OP_CROSS
           
protected  Operator OP_DIVIDE
           
protected  Operator OP_DOT
           
protected  Operator OP_ELEMENT
           
protected  Operator OP_EQ
           
protected  Operator OP_GE
           
protected  Operator OP_GT
          everyone can read but not write these operators
protected  Operator OP_LE
           
protected  Operator OP_LIST
           
protected  Operator OP_LT
           
protected  Operator OP_MOD
           
protected  Operator OP_MULTIPLY
           
protected  Operator OP_NE
           
protected  Operator OP_NOT
           
protected  Operator OP_OR
           
protected  Operator OP_POWER
           
protected  Operator OP_SUBTRACT
           
protected  Operator OP_UDIVIDE
          unary division i.e. 1/x or x^(-1)
protected  Operator OP_UMINUS
           
 
Constructor Summary
OperatorSet()
           
 
Method Summary
 Operator getAdd()
           
 Operator getAnd()
           
 Operator getAssign()
           
 Operator getCross()
           
 Operator getDivide()
           
 Operator getDot()
           
 Operator getElement()
           
 Operator getEQ()
           
 Operator getGE()
           
 Operator getGT()
           
 Operator getLE()
           
 Operator getList()
           
 Operator getLT()
           
 Operator getMod()
           
 Operator getMultiply()
           
 Operator getNE()
           
 Operator getNot()
           
 Operator[] getOperators()
          Gets the list of operators.
 Operator getOr()
           
 Operator getPower()
           
 Operator getSubtract()
           
 Operator getUMinus()
           
 void printOperators()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OP_GT

protected Operator OP_GT
everyone can read but not write these operators


OP_LT

protected Operator OP_LT

OP_EQ

protected Operator OP_EQ

OP_LE

protected Operator OP_LE

OP_GE

protected Operator OP_GE

OP_NE

protected Operator OP_NE

OP_AND

protected Operator OP_AND

OP_OR

protected Operator OP_OR

OP_NOT

protected Operator OP_NOT

OP_ADD

protected Operator OP_ADD

OP_SUBTRACT

protected Operator OP_SUBTRACT

OP_UMINUS

protected Operator OP_UMINUS

OP_MULTIPLY

protected Operator OP_MULTIPLY

OP_DIVIDE

protected Operator OP_DIVIDE

OP_MOD

protected Operator OP_MOD

OP_UDIVIDE

protected Operator OP_UDIVIDE
unary division i.e. 1/x or x^(-1)


OP_POWER

protected Operator OP_POWER

OP_ASSIGN

protected Operator OP_ASSIGN

OP_DOT

protected Operator OP_DOT

OP_CROSS

protected Operator OP_CROSS

OP_LIST

protected Operator OP_LIST

OP_ELEMENT

protected Operator OP_ELEMENT
Constructor Detail

OperatorSet

public OperatorSet()
Method Detail

getOperators

public Operator[] getOperators()
Gets the list of operators. Note subclasses should override this method.


printOperators

public void printOperators()

getAdd

public Operator getAdd()

getSubtract

public Operator getSubtract()

getUMinus

public Operator getUMinus()

getMultiply

public Operator getMultiply()

getDivide

public Operator getDivide()

getMod

public Operator getMod()

getPower

public Operator getPower()

getEQ

public Operator getEQ()

getNE

public Operator getNE()

getGE

public Operator getGE()

getGT

public Operator getGT()

getLE

public Operator getLE()

getLT

public Operator getLT()

getAnd

public Operator getAnd()

getOr

public Operator getOr()

getNot

public Operator getNot()

getAssign

public Operator getAssign()

getDot

public Operator getDot()

getCross

public Operator getCross()

getList

public Operator getList()

getElement

public Operator getElement()


http://www.singularsys.com/jep Copyright © 2007 Singular Systems