org.eclipse.incquery.runtime.rete.index

## Class AggregatorNode

- java.lang.Object
- - org.eclipse.incquery.runtime.rete.network.BaseNode
  - - org.eclipse.incquery.runtime.rete.network.StandardNode
    - - org.eclipse.incquery.runtime.rete.index.AggregatorNode

- All Implemented Interfaces:
    Node, Supplier
  Direct Known Subclasses:
    CountNode

      public abstract class AggregatorNode
      extends StandardNode

  A special node depending on a projection indexer to aggregate tuple groups with the same projection. Only propagates the aggregates of non-empty groups. Use the outer indexers to circumvent.
  Author:
    Gabor Bergmann

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AggregatorNode(ReteContainer reteContainer)` MUST call initializeWith() afterwards!

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract java.lang.Object` | `aggregateGroup(Tuple signature, java.util.Collection<Tuple> group)` Aggregates (reduces) a group of tuples.
    `java.lang.Object` | `aggregateGroupAfterUpdate(Tuple signature, java.util.Collection<Tuple> currentGroup, java.lang.Object oldAggregate, Direction direction, Tuple updateElement, boolean change)` Aggregates (reduces) a group of tuples, having access to the previous aggregated value (before the update) and the update definition.
    `void` | `assignTraceInfo(TraceInfo traceInfo)` assigns new traceability info to this node
    `org.eclipse.incquery.runtime.rete.index.AggregatorNode.AggregatorOuterIdentityIndexer` | `getAggregatorOuterIdentityIndexer(int resultPositionInSignature)`
    `org.eclipse.incquery.runtime.rete.index.AggregatorNode.AggregatorOuterIndexer` | `getAggregatorOuterIndexer()`
    `void` | `initializeWith(ProjectionIndexer projection)`
    `void` | `pullInto(java.util.Collection<Tuple> collector)` pulls the contents of this object in this particular moment into a target collection

    - ### Methods inherited from class org.eclipse.incquery.runtime.rete.network.StandardNode

      `appendChild, constructIndex, getPulledContents, getReceivers, removeChild`

    - ### Methods inherited from class org.eclipse.incquery.runtime.rete.network.BaseNode

      `acceptPropagatedTraceInfo, getContainer, getNodeId, getTag, getTraceInfos, setTag, toString`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.incquery.runtime.rete.network.Node

      `acceptPropagatedTraceInfo, getContainer, getNodeId, getTag, getTraceInfos, setTag`

- - ### Constructor Detail

    - #### AggregatorNode

          public AggregatorNode(ReteContainer reteContainer)

      MUST call initializeWith() afterwards!

  - ### Method Detail

    - #### initializeWith

          public void initializeWith(ProjectionIndexer projection)

      Parameters:
        `projection` - the projection indexer whose tuple groups should be aggregated

    - #### aggregateGroup

          public abstract java.lang.Object aggregateGroup(Tuple signature,
                                                          java.util.Collection<Tuple> group)

      Aggregates (reduces) a group of tuples. The group can be null.

    - #### aggregateGroupAfterUpdate

          public java.lang.Object aggregateGroupAfterUpdate(Tuple signature,
                                                            java.util.Collection<Tuple> currentGroup,
                                                            java.lang.Object oldAggregate,
                                                            Direction direction,
                                                            Tuple updateElement,
                                                            boolean change)

      Aggregates (reduces) a group of tuples, having access to the previous aggregated value (before the update) and the update definition. Defaults to aggregateGroup(). Override to increase performance.

    - #### getAggregatorOuterIndexer

          public org.eclipse.incquery.runtime.rete.index.AggregatorNode.AggregatorOuterIndexer getAggregatorOuterIndexer()

    - #### getAggregatorOuterIdentityIndexer

          public org.eclipse.incquery.runtime.rete.index.AggregatorNode.AggregatorOuterIdentityIndexer getAggregatorOuterIdentityIndexer(int resultPositionInSignature)

    - #### pullInto

          public void pullInto(java.util.Collection<Tuple> collector)

      Description copied from interface: `Supplier`
      pulls the contents of this object in this particular moment into a target collection

    - #### assignTraceInfo

          public void assignTraceInfo(TraceInfo traceInfo)

      Description copied from interface: `Node`
      assigns new traceability info to this node
      Specified by:
        `assignTraceInfo` in interface `Node`
      Overrides:
        `assignTraceInfo` in class `BaseNode`