Interface BufferSink

All Known Implementing Classes:
IntArrayBufferSink

public interface BufferSink
Interface of components that use a buffer to accumulate and collect data.

In a typical case, accumulation is performed one element at a time, by iterating an append process, whereas collection is performed in batches. This is useful as a generic base implementation for downsampling rate-conversion components.

However, this interface is abstract enough to allow other accumulation–collection strategies. In general, it is assumed that every element that has been accumulated is collected at most once, and thereby consumed from the buffer. Not all accumulated elements need be collected eventually, but the buffer may impose a maximum capacity.

Only the control-flow aspect of buffering is specified here; the data-flow from inputs for accumulation, and to outputs for collection, ist handled by concrete classes that implement this interface.

  • Method Details

    • getOverflowPolicy

      BufferSink.OverflowPolicy getOverflowPolicy()
      Returns the overflow policy of this component.
    • getCapacity

      Optional<Integer> getCapacity()
      Returns the capacity of this component.
      Returns:
      Optional.of(n) if this component can hold no more than n accumulated but uncollected elements; Optional.empty() if there is no fixed maxmimum number.
    • getAppendProcess

      Process getAppendProcess()
      Returns the process that performs accumulation for this component.
    • getCollectProcess

      Process getCollectProcess()
      Returns the process that performs collection for this component.