Package velox.api.layer1.dynamichistory
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 Summary
Modifier and TypeMethodDescriptionvoidapplyAggregationToSnapshot(T aggregation) default EbuildEventFromDelta(long timeFrom, long timeTo, T aggregation, double currentSizeIncrement, double targetSizeIncrement) Deprecated.default EbuildEventFromDelta(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.
-
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 (seeLayer1ApiDynamicHistoryListener.BlockContext). The snapshot event that opens a slice hastimeFrom == 0aggregation- the block's delta aggregationcurrentSizeIncrement- the size increment the stored data is intargetSizeIncrement- the size increment the produced event should be in- Returns:
- the event for this block; its
timeFrom/timeToshould be the context's window
-
buildEventFromDelta
@Deprecated default E buildEventFromDelta(long timeFrom, long timeTo, T aggregation, double currentSizeIncrement, double targetSizeIncrement) Deprecated.overridebuildEventFromDelta(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 anUnsupportedOperationExceptionfrom 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], seeDynamicHistoryEventaggregation- the block's delta aggregationcurrentSizeIncrement- the size increment the stored data is intargetSizeIncrement- the size increment the produced event should be in- Returns:
- the event for this block; its
timeFrom/timeToshould be the given window
-
applyAggregationToSnapshot
-
buildEventFromDelta(BlockContext, Aggregation, double, double)instead: it also tells the add-on by how much the window was shifted for a delayed instrument.