org.apache.expreval.expr
Class GenericExpression

java.lang.Object
  extended by org.apache.expreval.expr.GenericExpression
All Implemented Interfaces:
Serializable, GenericValue
Direct Known Subclasses:
BooleanNot, DelegateStmt, GenericCompare, GenericFunction

public abstract class GenericExpression
extends Object
implements GenericValue

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.apache.expreval.expr.node.GenericValue
serialVersionUID
 
Constructor Summary
protected GenericExpression(ExpressionType type, GenericValue... exprs)
           
protected GenericExpression(ExpressionType type, GenericValue expr, List<GenericValue> genericValueList)
           
protected GenericExpression(ExpressionType type, List<GenericValue> genericValueList)
           
 
Method Summary
 void applyResultToAggregateValue(AggregateValue aggregateValue, org.apache.hadoop.hbase.client.Result result)
           
 String asString()
           
protected  Object getConstantValue(int pos)
           
 GenericValue getExprArg(int i)
           
protected  MultipleExpressionContext getExpressionContext()
           
 org.apache.hadoop.hbase.filter.Filter getFilter()
           
protected  Class<? extends GenericValue> getGenericValueClass(Class<? extends GenericValue> clazz)
           
 List<GenericValue> getGenericValueList()
           
 String getInvalidTypeMsg(Class<? extends GenericValue>... classes)
           
 GenericValue getOptimizedValue()
           
protected  List<GenericValue> getSubArgs(int i)
           
protected  FunctionTypeSignature getTypeSignature()
           
protected  Number getValueWithCast(double result)
           
protected  Number getValueWithCast(long result)
           
 boolean hasAColumnReference()
           
 void initAggregateValue(AggregateValue aggregateValue)
           
 boolean isAColumnReference()
           
 boolean isAConstant()
           
 boolean isAnAggregateValue()
           
 boolean isDefaultKeyword()
           
protected  org.apache.hadoop.hbase.filter.Filter newSingleColumnValueFilter(ColumnAttrib attrib, org.apache.hadoop.hbase.filter.CompareFilter.CompareOp compareOp, org.apache.hadoop.hbase.filter.WritableByteArrayComparable comparator)
           
protected  void optimizeAllArgs()
           
 void reset()
           
 void setArg(int i, GenericValue val)
           
 void setExpressionContext(MultipleExpressionContext expressionContext)
           
protected  boolean useDecimal()
           
protected  Class validateNumericArgTypes(Object... objs)
           
protected  Class<? extends GenericValue> validateNumericTypes()
           
 void validateParentClass(Class<? extends GenericValue> parentClass, Class<? extends GenericValue>... childrenClasses)
           
 Class<? extends GenericValue> validateTypes(GenericValue parentExpr, boolean allowCollections)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.expreval.expr.node.GenericValue
getValue
 

Constructor Detail

GenericExpression

protected GenericExpression(ExpressionType type,
                            GenericValue... exprs)

GenericExpression

protected GenericExpression(ExpressionType type,
                            List<GenericValue> genericValueList)

GenericExpression

protected GenericExpression(ExpressionType type,
                            GenericValue expr,
                            List<GenericValue> genericValueList)
Method Detail

getTypeSignature

protected FunctionTypeSignature getTypeSignature()

getGenericValueList

public List<GenericValue> getGenericValueList()

getSubArgs

protected List<GenericValue> getSubArgs(int i)

useDecimal

protected boolean useDecimal()

getValueWithCast

protected Number getValueWithCast(long result)
                           throws HBqlException
Throws:
HBqlException

getValueWithCast

protected Number getValueWithCast(double result)
                           throws HBqlException
Throws:
HBqlException

validateNumericArgTypes

protected Class validateNumericArgTypes(Object... objs)

validateNumericTypes

protected Class<? extends GenericValue> validateNumericTypes()
                                                      throws HBqlException
Throws:
HBqlException

isAConstant

public boolean isAConstant()
Specified by:
isAConstant in interface GenericValue

isDefaultKeyword

public boolean isDefaultKeyword()
Specified by:
isDefaultKeyword in interface GenericValue

isAnAggregateValue

public boolean isAnAggregateValue()
Specified by:
isAnAggregateValue in interface GenericValue

initAggregateValue

public void initAggregateValue(AggregateValue aggregateValue)
                        throws HBqlException
Specified by:
initAggregateValue in interface GenericValue
Throws:
HBqlException

applyResultToAggregateValue

public void applyResultToAggregateValue(AggregateValue aggregateValue,
                                        org.apache.hadoop.hbase.client.Result result)
                                 throws HBqlException,
                                        ResultMissingColumnException,
                                        NullColumnValueException
Specified by:
applyResultToAggregateValue in interface GenericValue
Throws:
HBqlException
ResultMissingColumnException
NullColumnValueException

hasAColumnReference

public boolean hasAColumnReference()
Specified by:
hasAColumnReference in interface GenericValue

isAColumnReference

public boolean isAColumnReference()
Specified by:
isAColumnReference in interface GenericValue

reset

public void reset()
Specified by:
reset in interface GenericValue

setExpressionContext

public void setExpressionContext(MultipleExpressionContext expressionContext)
                          throws HBqlException
Specified by:
setExpressionContext in interface GenericValue
Throws:
HBqlException

getExpressionContext

protected MultipleExpressionContext getExpressionContext()

optimizeAllArgs

protected void optimizeAllArgs()
                        throws HBqlException
Throws:
HBqlException

newSingleColumnValueFilter

protected org.apache.hadoop.hbase.filter.Filter newSingleColumnValueFilter(ColumnAttrib attrib,
                                                                           org.apache.hadoop.hbase.filter.CompareFilter.CompareOp compareOp,
                                                                           org.apache.hadoop.hbase.filter.WritableByteArrayComparable comparator)
                                                                    throws HBqlException
Throws:
HBqlException

getConstantValue

protected Object getConstantValue(int pos)
                           throws HBqlException
Throws:
HBqlException

getExprArg

public GenericValue getExprArg(int i)

setArg

public void setArg(int i,
                   GenericValue val)

validateTypes

public Class<? extends GenericValue> validateTypes(GenericValue parentExpr,
                                                   boolean allowCollections)
                                            throws HBqlException
Specified by:
validateTypes in interface GenericValue
Throws:
HBqlException

getOptimizedValue

public GenericValue getOptimizedValue()
                               throws HBqlException
Specified by:
getOptimizedValue in interface GenericValue
Throws:
HBqlException

asString

public String asString()
Specified by:
asString in interface GenericValue

validateParentClass

public void validateParentClass(Class<? extends GenericValue> parentClass,
                                Class<? extends GenericValue>... childrenClasses)
                         throws InvalidTypeException
Throws:
InvalidTypeException

getInvalidTypeMsg

public String getInvalidTypeMsg(Class<? extends GenericValue>... classes)

getGenericValueClass

protected Class<? extends GenericValue> getGenericValueClass(Class<? extends GenericValue> clazz)
                                                      throws InvalidTypeException
Throws:
InvalidTypeException

getFilter

public org.apache.hadoop.hbase.filter.Filter getFilter()
                                                throws HBqlException
Specified by:
getFilter in interface GenericValue
Throws:
HBqlException


Copyright © 2011. All Rights Reserved.