org.concord.util.script
Class BinaryExpression
java.lang.Object
|
+--org.concord.util.script.ScriptObject
|
+--org.concord.util.script.Expression
|
+--org.concord.util.script.BinaryExpression
- All Implemented Interfaces:
- java.beans.BeanInfo
- Direct Known Subclasses:
- AndExpression, BitAndExpression, BitOrExpression, BitXorExpression, DivideExpression, EQExpression, ExponentExpression, GEExpression, GTExpression, LEExpression, LTExpression, MinusExpression, ModulusExpression, MultiplyExpression, NEExpression, OrExpression, PlusExpression
- public class BinaryExpression
- extends Expression
The BinaryExpression class is the base class for all binary operations.
It marshalls operands one and two and applies the binOp method which
should be implemented by a more specific derived class.
- Version:
- $Revision: 1.2 $ $Date: 2001/08/31 15:45:34 $
- Author:
- $Author: ed $
Field Summary |
protected java.util.Vector |
args
|
protected java.util.Vector |
ops
|
Fields inherited from class org.concord.util.script.ScriptObject |
beginColumn, beginLine, debug, deleted, doConversion, endColumn, endLine, name, nil, runtimeTable, script |
Fields inherited from interface java.beans.BeanInfo |
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32 |
Method Summary |
void |
addOperand(Expression expr)
Set the first operand of this expression. |
void |
addOperation(Expression expr)
Set the first operand of this expression. |
java.lang.Object |
binOp(java.lang.Object op1,
java.lang.Object op2)
This method should be overridden by a derived class. |
void |
delete()
|
void |
interpret()
The binary expression interpret checks if both operands are
expressions, and then applies the more derived binOp method. |
java.lang.String |
operatorString()
|
Methods inherited from class org.concord.util.script.ScriptObject |
findConstructor, findMethod, getAdditionalBeanInfo, getArrayValue, getAtom, getBeanDescriptor, getCurrentFrame, getDefaultEventIndex, getDefaultPropertyIndex, getEventSetDescriptors, getField, getFieldValue, getIcon, getMethodDescriptors, getName, getPropertyDescriptors, getScript, popFrame, pushFrame, setArrayValue, setCurrentFrame, setFieldValue, setName, setScript, setSourceBounds |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
args
protected java.util.Vector args
ops
protected java.util.Vector ops
BinaryExpression
protected BinaryExpression()
delete
public void delete()
- Overrides:
delete
in class ScriptObject
binOp
public java.lang.Object binOp(java.lang.Object op1,
java.lang.Object op2)
- This method should be overridden by a derived class.
(Maybe this method should be abstract.)
addOperand
public void addOperand(Expression expr)
- Set the first operand of this expression.
- Parameters:
expr
- Expression - operand of this opreation.
addOperation
public void addOperation(Expression expr)
- Set the first operand of this expression.
- Parameters:
expr
- Expression - operand of this opreation.
interpret
public void interpret()
- The binary expression interpret checks if both operands are
expressions, and then applies the more derived binOp method.
- Overrides:
interpret
in class Expression
operatorString
public java.lang.String operatorString()