com.espertech.esper.client.soda
Class SelectClause

java.lang.Object
  extended by com.espertech.esper.client.soda.SelectClause
All Implemented Interfaces:
Serializable

public class SelectClause
extends Object
implements Serializable

A select-clause consists of a list of selection elements (expressions, wildcard(s), stream wildcard and the like) and an optional stream selector.

See Also:
Serialized Form

Constructor Summary
protected SelectClause(StreamSelector streamSelector, List<SelectClauseElement> selectList)
          Ctor.
 
Method Summary
 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.
 SelectClause addStreamWildcard(String streamAliasName)
          Adds to the select-clause a stream wildcard selector (e.g.
 SelectClause addStreamWildcard(String streamAliasName, String columnAlias)
          Adds to the select-clause a stream wildcard selector with column alias (e.g.
 SelectClause addWildcard()
          Adds to the select-clause a wildcard selector (e.g.
 SelectClause addWithAlias(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 streamAliasName)
          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.
 List<SelectClauseElement> getSelectList()
          Returns the list of expressions in the select clause.
 StreamSelector getStreamSelector()
          Returns the stream selector.
 void setSelectList(List<SelectClauseElement> selectList)
          Sets the list of expressions in the select clause.
 SelectClause setStreamSelector(StreamSelector streamSelector)
          Sets the stream selector.
 void toEPL(StringWriter writer)
          Renders the clause in textual representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectClause

protected SelectClause(StreamSelector streamSelector,
                       List<SelectClauseElement> selectList)
Ctor.

Parameters:
streamSelector - selects the stream
selectList - is a list of elements in the select-clause
Method Detail

createWildcard

public static SelectClause createWildcard()
Creates a wildcard select-clause, additional expressions can still be added.

Returns:
select-clause

create

public static SelectClause create()
Creates an empty select-clause to be added to via add methods.

Returns:
select-clause

create

public static SelectClause create(String... propertyNames)
Creates a select-clause consisting of a list of property names.

Parameters:
propertyNames - is the names of properties to select
Returns:
select-clause

createStreamWildcard

public static SelectClause createStreamWildcard(String streamAliasName)
Creates a select-clause with a single stream wildcard selector (e.g. select streamAliasName.* from MyStream as streamAliasName)

Parameters:
streamAliasName - is the alias given to a stream
Returns:
select-clause

createWildcard

public static SelectClause createWildcard(StreamSelector streamSelector)
Creates a wildcard select-clause, additional expressions can still be added.

Parameters:
streamSelector - can be used to select insert or remove streams
Returns:
select-clause

create

public static SelectClause create(StreamSelector streamSelector)
Creates an empty select-clause.

Parameters:
streamSelector - can be used to select insert or remove streams
Returns:
select-clause

create

public static SelectClause create(StreamSelector streamSelector,
                                  String... propertyNames)
Creates a select-clause consisting of a list of property names.

Parameters:
propertyNames - is the names of properties to select
streamSelector - can be used to select insert or remove streams
Returns:
select-clause

add

public SelectClause add(String... propertyNames)
Adds property names to be selected.

Parameters:
propertyNames - is a list of property names to add
Returns:
clause

addWithAlias

public SelectClause addWithAlias(String propertyName,
                                 String asName)
Adds a single property name and an "as"-asName for the column.

Parameters:
propertyName - name of property
asName - is the "as"-asName for the column
Returns:
clause

add

public SelectClause add(Expression expression)
Adds an expression to the select clause.

Parameters:
expression - to add
Returns:
clause

add

public SelectClause add(Expression expression,
                        String asName)
Adds an expression to the select clause and an "as"-asName for the column.

Parameters:
expression - to add
asName - is the "as"-alias for the column
Returns:
clause

getStreamSelector

public StreamSelector getStreamSelector()
Returns the stream selector.

Returns:
stream selector

getSelectList

public List<SelectClauseElement> getSelectList()
Returns the list of expressions in the select clause.

Returns:
list of expressions with column aliases

addStreamWildcard

public SelectClause addStreamWildcard(String streamAliasName)
Adds to the select-clause a stream wildcard selector (e.g. select streamAliasName.* from MyStream as streamAliasName)

Parameters:
streamAliasName - is the alias given to a stream
Returns:
select-clause

addWildcard

public SelectClause addWildcard()
Adds to the select-clause a wildcard selector (e.g. select * from MyStream as streamAliasName)

Returns:
select-clause

addStreamWildcard

public SelectClause addStreamWildcard(String streamAliasName,
                                      String columnAlias)
Adds to the select-clause a stream wildcard selector with column alias (e.g. select streamAliasName.* as colAlias from MyStream as streamAliasName)

Parameters:
streamAliasName - is the alias given to a stream
columnAlias - the alias given to the column
Returns:
select-clause

setStreamSelector

public SelectClause setStreamSelector(StreamSelector streamSelector)
Sets the stream selector.

Parameters:
streamSelector - stream selector to set
Returns:
select clause

setSelectList

public void setSelectList(List<SelectClauseElement> selectList)
Sets the list of expressions in the select clause.

Parameters:
selectList - list of expressions with column aliases

toEPL

public void toEPL(StringWriter writer)
Renders the clause in textual representation.

Parameters:
writer - to output to

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com