Interface Accumulator<T>

  • Type Parameters:
    T - item type
    All Known Implementing Classes:
    AbstractAccumulator

    public interface Accumulator<T>
    Abstraction of an accumulator capable of collecting items and at some point in time triggers processing of all previously accumulated items.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void add​(T item)
      Adds an item to the current batch.
      boolean isReady()
      Indicates whether the accumulator is ready to process items.
      void processItems​(List<T> items)
      Processes the specified list of accumulated items.
    • Method Detail

      • add

        void add​(T item)
        Adds an item to the current batch. This operation may, or may not trigger processing of the current batch of items.
        Parameters:
        item - item to be added to the current batch
      • processItems

        void processItems​(List<T> items)
        Processes the specified list of accumulated items.
        Parameters:
        items - list of accumulated items
      • isReady

        boolean isReady()
        Indicates whether the accumulator is ready to process items.
        Returns:
        true if ready to process