public class SelectClause extends Object implements Serializable
Modifier | Constructor and Description |
---|---|
|
SelectClause()
Ctor.
|
protected |
SelectClause(StreamSelector streamSelector,
List<SelectClauseElement> selectList)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
SelectClause |
add(Expression expression)
Adds an expression to the select clause.
|
SelectClause |
add(Expression expression,
String asName)
Adds an expression to the select clause and an "as"-asName for the column.
|
SelectClause |
add(String... propertyNames)
Adds property names to be selected.
|
void |
addElements(List<SelectClauseElement> selectClauseElements)
Add a select expression element.
|
SelectClause |
addStreamWildcard(String streamName)
Adds to the select-clause a stream wildcard selector (e.g.
|
SelectClause |
addStreamWildcard(String streamName,
String columnName)
Adds to the select-clause a stream wildcard selector with column name (e.g.
|
SelectClause |
addWildcard()
Adds to the select-clause a wildcard selector (e.g.
|
SelectClause |
addWithAsProvidedName(String propertyName,
String asName)
Adds a single property name and an "as"-asName for the column.
|
static SelectClause |
create()
Creates an empty select-clause to be added to via add methods.
|
static SelectClause |
create(StreamSelector streamSelector)
Creates an empty select-clause.
|
static SelectClause |
create(StreamSelector streamSelector,
String... propertyNames)
Creates a select-clause consisting of a list of property names.
|
static SelectClause |
create(String... propertyNames)
Creates a select-clause consisting of a list of property names.
|
static SelectClause |
createStreamWildcard(String streamName)
Creates a select-clause with a single stream wildcard selector (e.g.
|
static SelectClause |
createWildcard()
Creates a wildcard select-clause, additional expressions can still be added.
|
static SelectClause |
createWildcard(StreamSelector streamSelector)
Creates a wildcard select-clause, additional expressions can still be added.
|
SelectClause |
distinct()
Sets distinct to true.
|
SelectClause |
distinct(boolean distinct)
Sets distinct
|
boolean |
getDistinct()
Returns indicator whether distinct or not.
|
List<SelectClauseElement> |
getSelectList()
Returns the list of expressions in the select clause.
|
StreamSelector |
getStreamSelector()
Returns the stream selector.
|
boolean |
isDistinct()
Returns indicator whether distinct or not.
|
void |
setDistinct(boolean distinct)
Returns indicator whether distinct or not.
|
void |
setSelectList(List<SelectClauseElement> selectList)
Sets the list of expressions in the select clause.
|
void |
setStreamSelector(StreamSelector streamSelector)
Sets the stream selector.
|
SelectClause |
streamSelector(StreamSelector streamSelector)
Sets the stream selector.
|
void |
toEPL(StringWriter writer,
EPStatementFormatter formatter,
boolean isTopLevel,
boolean andDelete)
Renders the clause in textual representation.
|
public SelectClause()
protected SelectClause(StreamSelector streamSelector, List<SelectClauseElement> selectList)
streamSelector
- selects the streamselectList
- is a list of elements in the select-clausepublic static SelectClause createWildcard()
public static SelectClause create()
public static SelectClause create(String... propertyNames)
propertyNames
- is the names of properties to selectpublic static SelectClause createStreamWildcard(String streamName)
streamName
- is the name given to a streampublic static SelectClause createWildcard(StreamSelector streamSelector)
streamSelector
- can be used to select insert or remove streamspublic static SelectClause create(StreamSelector streamSelector)
streamSelector
- can be used to select insert or remove streamspublic static SelectClause create(StreamSelector streamSelector, String... propertyNames)
propertyNames
- is the names of properties to selectstreamSelector
- can be used to select insert or remove streamspublic SelectClause add(String... propertyNames)
propertyNames
- is a list of property names to addpublic SelectClause addWithAsProvidedName(String propertyName, String asName)
propertyName
- name of propertyasName
- is the "as"-asName for the columnpublic SelectClause add(Expression expression)
expression
- to addpublic SelectClause add(Expression expression, String asName)
expression
- to addasName
- is the "as"-provided for the columnpublic List<SelectClauseElement> getSelectList()
public SelectClause addStreamWildcard(String streamName)
streamName
- is the name given to a streampublic SelectClause addWildcard()
public SelectClause addStreamWildcard(String streamName, String columnName)
streamName
- is the name given to a streamcolumnName
- the name given to the columnpublic void setStreamSelector(StreamSelector streamSelector)
streamSelector
- stream selector to setpublic SelectClause streamSelector(StreamSelector streamSelector)
streamSelector
- stream selector to setpublic StreamSelector getStreamSelector()
public void setSelectList(List<SelectClauseElement> selectList)
selectList
- list of expressions with column namespublic void addElements(List<SelectClauseElement> selectClauseElements)
selectClauseElements
- to addpublic void toEPL(StringWriter writer, EPStatementFormatter formatter, boolean isTopLevel, boolean andDelete)
writer
- to output toformatter
- for newline-whitespace formattingisTopLevel
- to indicate if this select-clause is inside other clauses.andDelete
- indicator whether select and deletepublic boolean isDistinct()
public boolean getDistinct()
public void setDistinct(boolean distinct)
distinct
- distinct indicatorpublic SelectClause distinct(boolean distinct)
distinct
- distinct indicatorpublic SelectClause distinct()