|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--wugle.expression.AbstractExpression | +--wugle.expression.AbstractBinaryOperator
An abstract implementation of BinaryOperator
.
AbstractBinaryOperator
provides a basic implementation of BinaryOperator
,
but is not meant to be a full class. Subclasses should implement the
appropriate operation interfaces.
Field Summary |
Fields inherited from class wugle.expression.AbstractExpression |
log, operation |
Constructor Summary | |
AbstractBinaryOperator(java.lang.String symbol,
ExpressionOperation operation,
Expression leftChild,
Expression rightChild)
Initializes the Expression and sets the initial child Expressions |
Method Summary | |
java.lang.Object |
clone()
Returns a copy of this Expression. |
Expression |
getLeftChild()
Gets the left child Expression. |
Expression |
getRightChild()
Gets the right child Expression. |
boolean |
isEqual(Expression expression)
Tests if this Expression is equal to the given Expression. |
void |
setChild(Expression oldChild,
Expression newChild)
Replaces a current child Expression with a new child Expression |
void |
setLeftChild(Expression child)
Sets the left child Expression. |
void |
setRightChild(Expression child)
Sets the right child Expression. |
java.lang.String |
toString()
Gets the String representation of the Expression. |
Methods inherited from class wugle.expression.AbstractExpression |
getParent, getSymbol, setParent |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface wugle.expression.Expression |
getParent, getSymbol, setParent |
Constructor Detail |
public AbstractBinaryOperator(java.lang.String symbol, ExpressionOperation operation, Expression leftChild, Expression rightChild)
symbol
- Symbol representing this Operatoroperation
- Object for delegating operations toleftChild
- Left child ExpressionrightChild
- Right child ExpressionMethod Detail |
public java.lang.String toString()
AbstractExpression
toString
in class AbstractExpression
AbstractExpression.getSymbol()
public java.lang.Object clone()
Expression
clone
in interface Expression
clone
in class AbstractExpression
public boolean isEqual(Expression expression)
Expression
isEqual
in interface Expression
expression
- Expression to compare to
true
if they are equalpublic void setChild(Expression oldChild, Expression newChild)
Operator
setChild
in interface Operator
oldChild
- Child Expression to replacenewChild
- Replacement child ExpressionsetLeftChild(Expression)
,
setRightChild(Expression)
public Expression getLeftChild()
BinaryOperator
getLeftChild
in interface BinaryOperator
null
if there is noneBinaryOperator.getRightChild()
,
BinaryOperator.setLeftChild(Expression)
public void setLeftChild(Expression child)
BinaryOperator
setLeftChild
in interface BinaryOperator
child
- The new left child Expression, or null
for no childBinaryOperator.getLeftChild()
,
BinaryOperator.setRightChild(Expression)
public Expression getRightChild()
BinaryOperator
getRightChild
in interface BinaryOperator
null
if there is noneBinaryOperator.getLeftChild()
,
BinaryOperator.setRightChild(Expression)
public void setRightChild(Expression child)
BinaryOperator
setRightChild
in interface BinaryOperator
child
- The new right child Expression, or null
for no childBinaryOperator.getRightChild()
,
BinaryOperator.setLeftChild(Expression)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |