com.espertech.esper.client.soda
Class FromClause

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

public class FromClause
extends java.lang.Object
implements java.io.Serializable

The from-clause names the streams to select upon.

The most common projected stream is a filter-based stream which is created by FilterStream.

Multiple streams can be joined by adding each stream individually.

Outer joins are also handled by this class. To create an outer join consisting of 2 streams, add one OuterJoinQualifier that defines the outer join relationship between the 2 streams. The outer joins between N streams, add N-1 OuterJoinQualifier qualifiers.

See Also:
Serialized Form

Constructor Summary
FromClause()
          Ctor.
FromClause(Stream... streamsList)
          Ctor.
FromClause(Stream streamOne, OuterJoinQualifier outerJoinQualifier, Stream streamTwo)
          Ctor for an outer join between two streams.
 
Method Summary
 FromClause add(OuterJoinQualifier outerJoinQualifier)
          Adds an outer join descriptor that defines how the streams are related via outer joins.
 FromClause add(Stream stream)
          Adds a stream.
static FromClause create()
          Creates an empty from-clause to which one adds streams via the add methods.
static FromClause create(Stream... streams)
          Creates a from clause that selects from a single stream.
static FromClause create(Stream stream, OuterJoinQualifier outerJoinQualifier, Stream streamSecond)
          Creates a from-clause that lists 2 projected streams joined via outer join.
 java.util.List<OuterJoinQualifier> getOuterJoinQualifiers()
          Returns the outer join descriptors, if this is an outer join, or an empty list if none of the streams are outer joined.
 java.util.List<Stream> getStreams()
          Returns the list of streams in the from-clause.
 void setOuterJoinQualifiers(java.util.List<OuterJoinQualifier> outerJoinQualifiers)
          Set outer joins.
 void setStreams(java.util.List<Stream> streams)
          Set the streams.
 void toEPL(java.io.StringWriter writer, EPStatementFormatter formatter)
          Renders the from-clause in textual representation.
 void toEPLOptions(java.io.StringWriter writer, EPStatementFormatter formatter, boolean includeFrom)
          Renders the from-clause in textual representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FromClause

public FromClause()
Ctor.


FromClause

public FromClause(Stream streamOne,
                  OuterJoinQualifier outerJoinQualifier,
                  Stream streamTwo)
Ctor for an outer join between two streams.

Parameters:
streamOne - first stream in outer join
outerJoinQualifier - type of outer join and fields joined on
streamTwo - second stream in outer join

FromClause

public FromClause(Stream... streamsList)
Ctor.

Parameters:
streamsList - is zero or more streams in the from-clause.
Method Detail

create

public static FromClause create()
Creates an empty from-clause to which one adds streams via the add methods.

Returns:
empty from clause

create

public static FromClause create(Stream stream,
                                OuterJoinQualifier outerJoinQualifier,
                                Stream streamSecond)
Creates a from-clause that lists 2 projected streams joined via outer join.

Parameters:
stream - first stream in outer join
outerJoinQualifier - qualifies the outer join
streamSecond - second stream in outer join
Returns:
from clause

create

public static FromClause create(Stream... streams)
Creates a from clause that selects from a single stream.

Use FilterStream to create filter-based streams to add.

Parameters:
streams - is one or more streams to add to the from clause.
Returns:
from clause

add

public FromClause add(Stream stream)
Adds a stream.

Use FilterStream to add filter-based streams.

Parameters:
stream - to add
Returns:
from clause

add

public FromClause add(OuterJoinQualifier outerJoinQualifier)
Adds an outer join descriptor that defines how the streams are related via outer joins.

For joining N streams, add N-1 outer join qualifiers.

Parameters:
outerJoinQualifier - is the type of outer join and the fields in the outer join
Returns:
from clause

getStreams

public java.util.List<Stream> getStreams()
Returns the list of streams in the from-clause.

Returns:
list of streams

toEPL

public void toEPL(java.io.StringWriter writer,
                  EPStatementFormatter formatter)
Renders the from-clause in textual representation.

Parameters:
writer - to output to
formatter - for newline-whitespace formatting

toEPLOptions

public void toEPLOptions(java.io.StringWriter writer,
                         EPStatementFormatter formatter,
                         boolean includeFrom)
Renders the from-clause in textual representation.

Parameters:
writer - to output to
includeFrom - flag whether to add the "from" literal
formatter - for newline-whitespace formatting

getOuterJoinQualifiers

public java.util.List<OuterJoinQualifier> getOuterJoinQualifiers()
Returns the outer join descriptors, if this is an outer join, or an empty list if none of the streams are outer joined.

Returns:
list of outer join qualifiers

setStreams

public void setStreams(java.util.List<Stream> streams)
Set the streams.

Parameters:
streams - to set

setOuterJoinQualifiers

public void setOuterJoinQualifiers(java.util.List<OuterJoinQualifier> outerJoinQualifiers)
Set outer joins.

Parameters:
outerJoinQualifiers - to set

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com