|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcetus.hir.SimpleExpression
public class SimpleExpression
SimpleExpression is another form of representing an expression which is effective in symbolic manipulation. Expressions with commutative and associative operators are flattend for easier manipulation, and only a subset of the Cetus expressions is represented specifically with an abbreviated operator name. Other types are marked as general "TREE" whose children are recursively represented using SimpleExpression.
| Field Summary | |
|---|---|
protected static int |
ADD
|
protected static int |
AND
|
protected static int |
BAND
|
protected static int |
BCMP
|
protected static int |
BOR
|
protected static int |
BXOR
|
protected static int |
DISTRIBUTE
|
protected static int |
DIV
|
protected static int |
DIVIDE
|
protected static int |
EQ
|
protected static int |
FACTORIZE
|
protected static int |
FOLD
|
protected static int |
GE
|
protected static int |
GT
|
protected static int |
ID
|
protected static int |
LE
|
protected static int |
LEAF
|
protected static int |
LIT
|
protected static int |
LOGIC
|
protected static int |
LT
|
protected static int |
MAX
|
protected static int |
MIN
|
protected static int |
MOD
|
protected static int |
MUL
|
protected static int |
NE
|
protected static int |
NEG
|
protected static int |
OR
|
protected static int |
SFTL
|
protected static int |
SFTR
|
protected static SimpleExpression |
sone
|
protected static SimpleExpression |
szero
|
protected static int |
TREE
|
protected static int |
verbosity
|
| Constructor Summary | |
|---|---|
protected |
SimpleExpression()
|
protected |
SimpleExpression(Expression e)
|
protected |
SimpleExpression(int sop)
|
protected |
SimpleExpression(SimpleExpression se)
|
protected |
SimpleExpression(SimpleExpression se1,
int op,
SimpleExpression se2)
|
| Method Summary | |
|---|---|
protected void |
add(SimpleExpression se)
|
protected static SimpleExpression |
add(SimpleExpression se1,
SimpleExpression se2)
|
protected void |
addAll(java.util.Collection<SimpleExpression> ses)
|
protected void |
addAll(SimpleExpression se)
|
java.lang.Object |
clone()
Returns a clone of this simple expression. |
int |
compare(SimpleExpression se1,
SimpleExpression se2)
Returns if a simple expression is greater than, less than, or equal to the other. |
int |
compareTo(SimpleExpression se)
Compares this simple expression with the given simple expression. |
protected boolean |
containsChildOfType(int op)
|
protected static SimpleExpression |
divide(SimpleExpression se1,
SimpleExpression se2)
|
boolean |
equals(java.lang.Object o)
Checks if this simple expression is equal to the given object. |
protected static int |
exchangeOp(int op)
|
protected static java.lang.Object |
getCetusOP(int op)
|
protected SimpleExpression |
getChild(int id)
|
protected java.util.List<SimpleExpression> |
getChildren()
|
protected SimpleExpression |
getCoef()
|
protected static SimpleExpression |
getDouble(double num)
|
protected Expression |
getExpression()
Returns a reconstructed Cetus expression from the simple expression. |
protected Expression |
getExprRef()
|
protected static SimpleExpression |
getInt(int num)
|
protected static SimpleExpression |
getLCD(java.util.List<SimpleExpression> ses)
|
protected static SimpleExpression |
getLCM(java.util.List<SimpleExpression> ses)
|
protected int |
getOP()
|
protected static int |
getOption()
|
protected int |
getOrder()
|
protected SimpleExpression |
getTerm()
|
protected java.lang.Double |
getValue()
|
protected boolean |
isCommAssoc()
|
protected boolean |
isCompare()
|
protected static SimpleExpression |
mod(SimpleExpression se1,
SimpleExpression se2)
|
protected static SimpleExpression |
multiply(SimpleExpression se1,
SimpleExpression se2)
|
protected java.util.List<SimpleExpression> |
multiplyByLCM()
|
protected static int |
negateOp(int op)
|
protected SimpleExpression |
normalize()
|
protected SimpleExpression |
normalizeDivisible()
|
protected void |
setChild(int id,
SimpleExpression child)
|
protected static void |
setOption(int opt)
|
protected void |
sort()
|
protected static SimpleExpression |
subtract(SimpleExpression se1,
SimpleExpression se2)
|
protected SimpleExpression |
toDivision()
|
java.lang.String |
toString()
Returns a string representation of the simple expression. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final int ADD
protected static final int MUL
protected static final int DIV
protected static final int MOD
protected static final int SFTL
protected static final int SFTR
protected static final int BAND
protected static final int BOR
protected static final int BXOR
protected static final int BCMP
protected static final int AND
protected static final int OR
protected static final int EQ
protected static final int NE
protected static final int LE
protected static final int LT
protected static final int GE
protected static final int GT
protected static final int NEG
protected static final int TREE
protected static final int ID
protected static final int LIT
protected static final int LEAF
protected static final int MIN
protected static final int MAX
protected static final SimpleExpression sone
protected static final SimpleExpression szero
protected static final int verbosity
protected static final int FACTORIZE
protected static final int FOLD
protected static final int DISTRIBUTE
protected static final int DIVIDE
protected static final int LOGIC
| Constructor Detail |
|---|
protected SimpleExpression()
protected SimpleExpression(int sop)
protected SimpleExpression(SimpleExpression se)
protected SimpleExpression(SimpleExpression se1,
int op,
SimpleExpression se2)
protected SimpleExpression(Expression e)
| Method Detail |
|---|
protected void add(SimpleExpression se)
protected void addAll(java.util.Collection<SimpleExpression> ses)
protected void addAll(SimpleExpression se)
protected static SimpleExpression getInt(int num)
protected static SimpleExpression getDouble(double num)
public java.lang.String toString()
toString in class java.lang.Objectprotected Expression getExpression()
protected SimpleExpression getChild(int id)
protected void setChild(int id,
SimpleExpression child)
protected static void setOption(int opt)
protected boolean isCommAssoc()
protected boolean isCompare()
protected boolean containsChildOfType(int op)
public int compareTo(SimpleExpression se)
compareTo in interface java.lang.Comparable<SimpleExpression>the - given simple expression.
public java.lang.Object clone()
clone in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in interface java.util.Comparator<SimpleExpression>equals in class java.lang.Objectthe - given object.
public int compare(SimpleExpression se1,
SimpleExpression se2)
compare in interface java.util.Comparator<SimpleExpression>se1 - the first simple expression.se2 - the second simple expression.
protected SimpleExpression getTerm()
protected java.lang.Double getValue()
protected static SimpleExpression add(SimpleExpression se1,
SimpleExpression se2)
protected static SimpleExpression subtract(SimpleExpression se1,
SimpleExpression se2)
protected static SimpleExpression multiply(SimpleExpression se1,
SimpleExpression se2)
protected static SimpleExpression divide(SimpleExpression se1,
SimpleExpression se2)
protected static SimpleExpression mod(SimpleExpression se1,
SimpleExpression se2)
protected void sort()
protected SimpleExpression getCoef()
protected SimpleExpression normalize()
protected static SimpleExpression getLCM(java.util.List<SimpleExpression> ses)
protected static SimpleExpression getLCD(java.util.List<SimpleExpression> ses)
protected java.util.List<SimpleExpression> multiplyByLCM()
protected SimpleExpression normalizeDivisible()
protected SimpleExpression toDivision()
protected static int negateOp(int op)
protected static int exchangeOp(int op)
protected static int getOption()
protected int getOrder()
protected Expression getExprRef()
protected int getOP()
protected java.util.List<SimpleExpression> getChildren()
protected static java.lang.Object getCetusOP(int op)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||