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[]
children
protected Object
constantValue
protected boolean
hasAggregates
protected TupleDefinition
inputDef
protected DataType
type
-
Constructor Summary
Constructors Constructor Description Expression(Expression[] children)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addFilter(FilterableTarget tableStream)
add a filter to the table if applicable.void
bind(TupleDefinition inputDef2)
void
collectAggregates(List<AggregateExpression> list)
void
collectRequiredInputs(Set<ColumnDefinition> inputs)
CompiledExpression
compile()
protected abstract void
doBind()
protected void
fillCode_Constructor(StringBuilder code)
protected void
fillCode_Declarations(StringBuilder code)
protected void
fillCode_getValueBody(StringBuilder code)
abstract void
fillCode_getValueReturn(StringBuilder code)
protected void
fillCode_InputDefVars(Collection<ColumnDefinition> inputs, StringBuilder code)
String
getColumnName()
when the expression behaves like a column expression, this is the column nameObject
getConstantValue()
DataType
getType()
protected boolean
isAggregate()
boolean
isConstant()
void
setColumnName(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()
-
-