Package org.yamcs.yarch.streamsql
Class Expression
- java.lang.Object
-
- org.yamcs.yarch.streamsql.Expression
-
- Direct Known Subclasses:
AdditiveExpression,AggregateExpression,AndExpression,ColumnExpression,ExponentExpression,ExtractNumberExpression,InExpression,LikeExpression,MultiplicativeExpression,NegativeExpression,NotExpression,OrExpression,RelationalExpression,SubstringExpression,UnhexExpression,ValueExpression
public abstract class Expression extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected Expression[]childrenprotected ObjectconstantValueprotected booleanhasAggregatesprotected TupleDefinitioninputDefprotected DataTypetype
-
Constructor Summary
Constructors Constructor Description Expression(Expression[] children)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddFilter(FilterableTarget tableStream)add a filter to the table if applicable.voidbind(TupleDefinition inputDef2)voidcollectAggregates(List<AggregateExpression> list)voidcollectRequiredInputs(Set<ColumnDefinition> inputs)CompiledExpressioncompile()protected abstract voiddoBind()protected voidfillCode_Constructor(StringBuilder code)protected voidfillCode_Declarations(StringBuilder code)protected voidfillCode_getValueBody(StringBuilder code)abstract voidfillCode_getValueReturn(StringBuilder code)protected voidfillCode_InputDefVars(Collection<ColumnDefinition> inputs, StringBuilder code)StringgetColumnName()when the expression behaves like a column expression, this is the column nameObjectgetConstantValue()DataTypegetType()protected booleanisAggregate()booleanisConstant()voidsetColumnName(String name)
-
-
-
Field Detail
-
type
protected DataType type
-
children
protected Expression[] children
-
inputDef
protected TupleDefinition inputDef
-
hasAggregates
protected boolean hasAggregates
-
constantValue
protected Object constantValue
-
-
Constructor Detail
-
Expression
public Expression(Expression[] children)
-
-
Method Detail
-
isAggregate
protected boolean isAggregate()
-
isConstant
public final boolean isConstant()
-
addFilter
public void addFilter(FilterableTarget tableStream) throws StreamSqlException
add a filter to the table if applicable.- Parameters:
tableStream-- Throws:
StreamSqlException
-
collectAggregates
public void collectAggregates(List<AggregateExpression> list)
-
doBind
protected abstract void doBind() throws StreamSqlException- Throws:
StreamSqlException
-
bind
public void bind(TupleDefinition inputDef2) throws StreamSqlException
- Throws:
StreamSqlException
-
getType
public DataType getType()
-
fillCode_Declarations
protected void fillCode_Declarations(StringBuilder code)
-
fillCode_Constructor
protected void fillCode_Constructor(StringBuilder code) throws StreamSqlException
- Throws:
StreamSqlException
-
collectRequiredInputs
public void collectRequiredInputs(Set<ColumnDefinition> inputs)
-
fillCode_InputDefVars
protected void fillCode_InputDefVars(Collection<ColumnDefinition> inputs, StringBuilder code)
-
fillCode_getValueBody
protected void fillCode_getValueBody(StringBuilder code) throws StreamSqlException
- Throws:
StreamSqlException
-
fillCode_getValueReturn
public abstract void fillCode_getValueReturn(StringBuilder code) throws StreamSqlException
- Throws:
StreamSqlException
-
compile
public CompiledExpression compile() throws StreamSqlException
- Throws:
StreamSqlException
-
getColumnName
public String getColumnName()
when the expression behaves like a column expression, this is the column name- Returns:
-
setColumnName
public void setColumnName(String name)
-
getConstantValue
public Object getConstantValue()
-
-