Class AggregateReader.AggregateOperation

java.lang.Object
com.northconcepts.datapipeline.group.AggregateReader.AggregateOperation
Enclosing class:
AggregateReader

public abstract static class AggregateReader.AggregateOperation extends Object
Base class for the set functions an AggregateReader applies to each record passing through it.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    AggregateOperation(String name, String fieldName)
    Creates an operation; its name (such as sum) and fieldName together identify it in the reader.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    accept(Record record)
    Updates this operation's result with a record passing through the reader.
    abstract Object
    Returns this operation's result so far.
    abstract void
    Clears this operation's result; called when the reader is opened or reset.
     
    static String
    toString(String name, String fieldName)
    Returns the key identifying an operation, such as sum of AMOUNT for name sum and field amount.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • fieldName

      protected final String fieldName
  • Constructor Details

    • AggregateOperation

      public AggregateOperation(String name, String fieldName)
      Creates an operation; its name (such as sum) and fieldName together identify it in the reader.
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public static String toString(String name, String fieldName)
      Returns the key identifying an operation, such as sum of AMOUNT for name sum and field amount.
    • accept

      public abstract void accept(Record record)
      Updates this operation's result with a record passing through the reader.
    • evaluate

      public abstract Object evaluate()
      Returns this operation's result so far.
    • reset

      public abstract void reset()
      Clears this operation's result; called when the reader is opened or reset.