|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.singularsys.jep.OperatorTable2
public class OperatorTable2
An operator table where operators are identified by enums.
| Nested Class Summary | |
|---|---|
static class |
OperatorTable2.BasicOperators
The basic arithmetic comparative and logical operators |
static interface |
OperatorTable2.OperatorKey
All operators enums must implement this interface. |
static class |
OperatorTable2.PsudoOperators
Operators which do not correspond to |
static class |
OperatorTable2.SpecialOperators
Special purpose operators |
| Constructor Summary | |
|---|---|
OperatorTable2()
|
|
OperatorTable2(OperatorTable2 oldTable)
Decorator constructor. |
|
| Method Summary | |
|---|---|
Operator |
addOperator(OperatorTable2.OperatorKey key,
Operator op)
Add a operator with a given key. |
Operator |
addOperator(OperatorTable2.OperatorKey key,
Operator op,
Operator existingOp)
Add operator with the same precedence level as an existing operator. |
Operator |
appendOperator(OperatorTable2.OperatorKey key,
Operator op,
Operator existingOp)
Add an operator with a new precedence level which is lower than the existing op. |
java.util.Set<java.util.Map.Entry<OperatorTable2.OperatorKey,Operator>> |
entrySet()
|
Operator |
getAdd()
|
Operator |
getAnd()
|
Operator |
getAssign()
|
Operator |
getCross()
|
Operator |
getDivide()
|
Operator |
getDot()
|
Operator |
getEle()
|
Operator |
getEQ()
|
Operator |
getGE()
|
Operator |
getGT()
|
OperatorTable2.OperatorKey |
getKey(Operator op)
Gets the key associated with a specific operator |
Operator |
getLE()
|
JepComponent |
getLightWeightInstance()
Gets a light-weight instance suitable for using in multiple threads. |
Operator |
getList()
|
Operator |
getLT()
|
Operator |
getMod()
|
Operator |
getMultiply()
|
Operator |
getNE()
|
Operator |
getNop()
|
Operator |
getNot()
|
int |
getNumOps()
|
Operator |
getOperator(OperatorTable2.OperatorKey key)
Get operator by its key code. |
java.util.Collection<Operator> |
getOperators()
Return the full list of operators |
Operator |
getOperatorsByName(java.lang.String name)
Get the operator with a given name |
java.util.List<Operator> |
getOperatorsBySymbol(java.lang.String symbol)
Gets all the operators with a given symbol |
Operator |
getOr()
|
Operator |
getPower()
|
Operator |
getRange()
|
Operator |
getSubtract()
|
Operator |
getUDivide()
unary division i.e. 1/x or x^(-1) * |
Operator |
getUMinus()
|
Operator |
getUPlus()
|
void |
init(Jep jep)
Initialize the component. |
Operator |
insertOperator(OperatorTable2.OperatorKey key,
Operator op,
Operator existingOp)
Add operator with the same precedence level as an existing operator. |
java.util.Set<OperatorTable2.OperatorKey> |
keySet()
|
void |
removeOperator(Operator op)
Remove a give operator from the table |
void |
removeOperator(OperatorTable2.OperatorKey key)
Remove a give operator from the table |
void |
replaceOperator(Operator oldOp,
Operator op)
Replace a give operator with a new one. |
void |
replaceOperator(OperatorTable2.OperatorKey key,
Operator op)
Replace a give operator with a new one. |
protected boolean |
setBinaryInverseOp(OperatorTable2.OperatorKey key1,
OperatorTable2.OperatorKey key2)
|
protected boolean |
setDistributiveOver(OperatorTable2.OperatorKey key1,
OperatorTable2.OperatorKey key2)
|
protected boolean |
setInverseOp(OperatorTable2.OperatorKey key1,
OperatorTable2.OperatorKey key2)
|
boolean |
setPrecedenceTable(OperatorTable2.OperatorKey[][] precArray)
Sets the precedence of all operators at one time. |
protected boolean |
setRootOp(OperatorTable2.OperatorKey key1,
OperatorTable2.OperatorKey key2)
|
protected void |
setStandardOperatorRelations()
Sets up the standard relations between +,-,*,/ |
java.lang.String |
toString()
String rep operators ordered by precedence, one per line. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OperatorTable2()
public OperatorTable2(OperatorTable2 oldTable)
oldTable - | Method Detail |
|---|
public void init(Jep jep)
JepComponent
init in interface JepComponentjep - the current Jep instancepublic int getNumOps()
public Operator addOperator(OperatorTable2.OperatorKey key,
Operator op)
key - integer key valueop -
public Operator addOperator(OperatorTable2.OperatorKey key,
Operator op,
Operator existingOp)
key - op - existingOp -
public Operator insertOperator(OperatorTable2.OperatorKey key,
Operator op,
Operator existingOp)
op - existingOp -
public Operator appendOperator(OperatorTable2.OperatorKey key,
Operator op,
Operator existingOp)
key - op - existingOp -
public OperatorTable2.OperatorKey getKey(Operator op)
op -
public void removeOperator(Operator op)
op - public void removeOperator(OperatorTable2.OperatorKey key)
key -
public void replaceOperator(Operator oldOp,
Operator op)
oldOp - the operator to be replacedop - the new operator
public void replaceOperator(OperatorTable2.OperatorKey key,
Operator op)
key - the key for the operatorop - the new operatorpublic Operator getOperator(OperatorTable2.OperatorKey key)
key - code used in the table
public java.util.List<Operator> getOperatorsBySymbol(java.lang.String symbol)
getOperatorsBySymbol in interface OperatorTableIsymbol - symbol used for operator
public Operator getOperatorsByName(java.lang.String name)
getOperatorsByName in interface OperatorTableIname - unique name of operator
public java.util.Collection<Operator> getOperators()
getOperators in interface OperatorTableIpublic java.util.Set<java.util.Map.Entry<OperatorTable2.OperatorKey,Operator>> entrySet()
public java.util.Set<OperatorTable2.OperatorKey> keySet()
public final boolean setPrecedenceTable(OperatorTable2.OperatorKey[][] precArray)
setPrecedenceTable(new OperatorKey[][] {
{ POWER },
{ NEG, UPLUS, NOT },
{ MUL, DIV, MOD, DOT, CROSS },
{ ADD, SU },
{ LT, LE, GT, GE },
{ EQ, NE },
{ AND },
{ OR },
{ ASSIGN },
});
precArray -
protected boolean setInverseOp(OperatorTable2.OperatorKey key1,
OperatorTable2.OperatorKey key2)
protected boolean setBinaryInverseOp(OperatorTable2.OperatorKey key1,
OperatorTable2.OperatorKey key2)
protected boolean setRootOp(OperatorTable2.OperatorKey key1,
OperatorTable2.OperatorKey key2)
protected boolean setDistributiveOver(OperatorTable2.OperatorKey key1,
OperatorTable2.OperatorKey key2)
protected void setStandardOperatorRelations()
public Operator getNop()
getNop in interface OperatorTableIpublic Operator getAdd()
getAdd in interface OperatorTableIpublic Operator getSubtract()
getSubtract in interface OperatorTableIpublic Operator getUMinus()
getUMinus in interface OperatorTableIpublic Operator getUPlus()
getUPlus in interface OperatorTableIpublic Operator getMultiply()
getMultiply in interface OperatorTableIpublic Operator getDivide()
getDivide in interface OperatorTableIpublic Operator getMod()
getMod in interface OperatorTableIpublic Operator getUDivide()
getUDivide in interface OperatorTableIpublic Operator getPower()
getPower in interface OperatorTableIpublic Operator getGT()
getGT in interface OperatorTableIpublic Operator getLT()
getLT in interface OperatorTableIpublic Operator getEQ()
getEQ in interface OperatorTableIpublic Operator getLE()
getLE in interface OperatorTableIpublic Operator getGE()
getGE in interface OperatorTableIpublic Operator getNE()
getNE in interface OperatorTableIpublic Operator getAnd()
getAnd in interface OperatorTableIpublic Operator getOr()
getOr in interface OperatorTableIpublic Operator getNot()
getNot in interface OperatorTableIpublic Operator getAssign()
getAssign in interface OperatorTableIpublic Operator getDot()
getDot in interface OperatorTableIpublic Operator getCross()
getCross in interface OperatorTableIpublic Operator getList()
getList in interface OperatorTableIpublic Operator getEle()
getEle in interface OperatorTableIpublic Operator getRange()
getRange in interface OperatorTableIpublic java.lang.String toString()
toString in class java.lang.Objectpublic JepComponent getLightWeightInstance()
JepComponent
getLightWeightInstance in interface JepComponent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||