public abstract class BaseAssemblyNode extends Object implements ResultAssembler
The tree is double-linked, child nodes know each parent and parent know all child nodes.
Each specific subclass of this abstract assembly node is dedicated to assembling results for a certain event stream.
Modifier and Type | Field and Description |
---|---|
protected List<BaseAssemblyNode> |
childNodes
Child nodes.
|
protected int |
numStreams
Number of streams in statement.
|
protected ResultAssembler |
parentNode
Parent node.
|
protected int |
streamNum
Stream number.
|
Modifier | Constructor and Description |
---|---|
protected |
BaseAssemblyNode(int streamNum,
int numStreams)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(BaseAssemblyNode childNode)
Add a child node.
|
protected List<BaseAssemblyNode> |
getChildNodes()
Returns child nodes.
|
protected int |
getStreamNum()
Returns the stream number.
|
protected int[] |
getSubstreams()
Returns an array of stream numbers that lists all child node's stream numbers.
|
abstract void |
init(List<Node>[] result)
Provides results to assembly nodes for initialization.
|
abstract void |
print(IndentWriter indentWriter)
Output this node using writer, not outputting child nodes.
|
abstract void |
process(List<Node>[] result,
Collection<EventBean[]> resultFinalRows,
EventBean resultRootEvent)
Process results.
|
void |
setParentAssembler(ResultAssembler resultAssembler)
Set parent node.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
result
protected ResultAssembler parentNode
protected final List<BaseAssemblyNode> childNodes
protected final int streamNum
protected final int numStreams
protected BaseAssemblyNode(int streamNum, int numStreams)
streamNum
- - stream number of the event stream that this node assembles results for.numStreams
- - number of streamspublic abstract void init(List<Node>[] result)
result
- is a list of result nodes per streampublic abstract void process(List<Node>[] result, Collection<EventBean[]> resultFinalRows, EventBean resultRootEvent)
result
- is a list of result nodes per streamresultFinalRows
- final row collectionresultRootEvent
- root eventpublic abstract void print(IndentWriter indentWriter)
indentWriter
- to use for outputpublic void setParentAssembler(ResultAssembler resultAssembler)
resultAssembler
- is the parent nodepublic void addChild(BaseAssemblyNode childNode)
childNode
- to addprotected int getStreamNum()
protected List<BaseAssemblyNode> getChildNodes()
protected int[] getSubstreams()