Interface Layer1ApiDynamicHistoryListener.SnapshotState<T extends com.bookmap.api.Aggregation,E extends DynamicHistoryEvent>

Enclosing interface:
Layer1ApiDynamicHistoryListener

public static interface Layer1ApiDynamicHistoryListener.SnapshotState<T extends com.bookmap.api.Aggregation,E extends DynamicHistoryEvent>
  • Method Details

    • buildEventFromDelta

      default E buildEventFromDelta(Layer1ApiDynamicHistoryListener.BlockContext context, T aggregation, double currentSizeIncrement, double targetSizeIncrement)
      Builds a Bookmap event for a single historical block from a delta aggregation, using the snapshot state accumulated from previous blocks.

      Override this method. The default implementation only exists to keep add-ons written against buildEventFromDelta(long, long, Aggregation, double, double) working, and delegates to it.

      Parameters:
      context - the block's window on the chart's time axis, and the data delay that was applied to it (see Layer1ApiDynamicHistoryListener.BlockContext). The snapshot event that opens a slice has timeFrom == 0
      aggregation - the block's delta aggregation
      currentSizeIncrement - the size increment the stored data is in
      targetSizeIncrement - the size increment the produced event should be in
      Returns:
      the event for this block; its timeFrom/timeTo should be the context's window
    • buildEventFromDelta

      @Deprecated default E buildEventFromDelta(long timeFrom, long timeTo, T aggregation, double currentSizeIncrement, double targetSizeIncrement)
      Deprecated.
      override buildEventFromDelta(BlockContext, Aggregation, double, double) instead: it also tells the add-on by how much the window was shifted for a delayed instrument. This method is only ever called through the default implementation of the new one; an add-on that overrides neither gets an UnsupportedOperationException from here.
      Builds a Bookmap event for a single historical block from a delta aggregation, using the snapshot state accumulated from previous blocks.
      Parameters:
      timeFrom - start of the block's time window, in nanoseconds (exclusive)
      timeTo - end of the block's time window, in nanoseconds (inclusive) - the window is (timeFrom, timeTo], see DynamicHistoryEvent
      aggregation - the block's delta aggregation
      currentSizeIncrement - the size increment the stored data is in
      targetSizeIncrement - the size increment the produced event should be in
      Returns:
      the event for this block; its timeFrom/timeTo should be the given window
    • applyAggregationToSnapshot

      void applyAggregationToSnapshot(T aggregation)