|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.org.ogsadai.expression.arithmetic.BinaryExpression
public abstract class BinaryExpression
A binary numeric operator in an arithmetic expression.
| Field Summary | |
|---|---|
protected int |
mContextType
Context dependent type. |
protected Evaluator |
mEval
Evaluator for this operator. |
protected ArithmeticExpression |
mLeftChild
left child expression. |
protected ColumnMetadata |
mOriginalType
Type of this table column. |
protected ArithmeticExpression |
mRightChild
right child expression. |
protected ColumnMetadata |
mType
Return type. |
| Constructor Summary | |
|---|---|
BinaryExpression(ArithmeticExpression child1,
ArithmeticExpression child2)
Constructs a new binary numeric operator with the given children. |
|
| Method Summary | |
|---|---|
void |
configure(TupleMetadata metadata)
Configures the expression with the metadata. |
void |
configure(TupleMetadata metadata,
java.util.Set<Attribute> correlatedAttributes)
Configures the expression with the metadata. |
void |
evaluate(Tuple tuple)
Evaluates the arithmetic expression on the given input tuple. |
ArithmeticExpression[] |
getChildren()
Returns the children of this arithmetic expression. |
ArithmeticExpression |
getLeftExpression()
Gets left operand expression. |
ColumnMetadata |
getMetadata()
Get the result type that is returned when evaluating this expression with tuples of the given type. |
java.lang.Object |
getResult()
Returns the result of the evaluation. |
ArithmeticExpression |
getRightExpression()
Gets right operand expression. |
abstract java.lang.Number |
localEvaluate(java.lang.Number lhs,
java.lang.Number rhs)
Performs operation specific evaluation. |
protected abstract void |
printOperator(java.lang.StringBuffer buf)
Append the operator name (e.g. |
void |
resetType()
Reset type to original. |
void |
setContextType(int type)
Set context type for an expression. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface uk.org.ogsadai.expression.arithmetic.ArithmeticExpression |
|---|
accept |
| Field Detail |
|---|
protected Evaluator mEval
protected ArithmeticExpression mLeftChild
protected ArithmeticExpression mRightChild
protected ColumnMetadata mType
protected ColumnMetadata mOriginalType
protected int mContextType
| Constructor Detail |
|---|
public BinaryExpression(ArithmeticExpression child1,
ArithmeticExpression child2)
child1 - left hand child expressionchild2 - right hand child expression| Method Detail |
|---|
public void setContextType(int type)
setContextType in interface ArithmeticExpressiontype - context tuple typepublic void resetType()
resetType in interface ArithmeticExpression
public abstract java.lang.Number localEvaluate(java.lang.Number lhs,
java.lang.Number rhs)
lhs - left hand side valuerhs - right hand side value
public final void evaluate(Tuple tuple)
throws ExpressionEvaluationException
evaluate in interface ArithmeticExpressiontuple - input tuple
ExpressionEvaluationException - if expression can not be evaluatedpublic final java.lang.Object getResult()
getResult in interface ArithmeticExpressionpublic ArithmeticExpression[] getChildren()
getChildren in interface ArithmeticExpression
public void configure(TupleMetadata metadata)
throws TypeMismatchException
getMetadata().
This method is also used for type validation.
configure in interface ArithmeticExpressionmetadata - tuple metadata
TypeMismatchException - when the operand types are incompatible
public void configure(TupleMetadata metadata,
java.util.Set<Attribute> correlatedAttributes)
throws TypeMismatchException
getMetadata().
This method is also used for type validation. A set of correlated
attributes can be passed in to support type validation of correlated
attributes.
configure in interface ArithmeticExpressionmetadata - tuple metadatacorrelatedAttributes - set of correlated attributes, containing their types.
TypeMismatchException - when the operand types are incompatiblepublic ColumnMetadata getMetadata()
getMetadata in interface ArithmeticExpressionprotected abstract void printOperator(java.lang.StringBuffer buf)
buf - bufferpublic ArithmeticExpression getLeftExpression()
public ArithmeticExpression getRightExpression()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||