-
- All Implemented Interfaces:
-
com.patrykandpatrick.vico.core.entry.ChartModelProducer
public final class ComposedChartEntryModelProducer<Model extends ChartEntryModel> implements ChartModelProducer<ComposedChartEntryModel<Model>>
A ChartModelProducer implementation that generates ComposedChartEntryModel instances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classComposedChartEntryModelProducer.Companion
-
Field Summary
Fields Modifier and Type Field Description private final List<ChartModelProducer<Model>>chartModelProducers
-
Constructor Summary
Constructors Constructor Description ComposedChartEntryModelProducer(ChartModelProducer<Model> chartModelProducers, Executor backgroundExecutor)ComposedChartEntryModelProducer(List<ChartModelProducer<Model>> chartModelProducers, Executor backgroundExecutor)
-
Method Summary
Modifier and Type Method Description final List<ChartModelProducer<Model>>getChartModelProducers()ComposedChartEntryModel<Model>getModel()Returns the ChartEntryModel for this ChartModelProducer synchronously. UnitprogressModel(Object key, Float progress)Calculates an intermediate list of entries for difference animations for the associated key, where progress is the balance between the previous and current lists of entries. UnitregisterForUpdates(Object key, Function0<Unit> updateListener, Function0<ComposedChartEntryModel<Model>> getOldModel, Function1<ComposedChartEntryModel<Model>, Unit> onModel)Registers an update listener associated with a key. UnitunregisterFromUpdates(Object key)Unregisters the update listener associated with the given key. BooleanisRegistered(Object key)Checks if an update listener with the given key is registered. -
-
Constructor Detail
-
ComposedChartEntryModelProducer
ComposedChartEntryModelProducer(ChartModelProducer<Model> chartModelProducers, Executor backgroundExecutor)
-
ComposedChartEntryModelProducer
ComposedChartEntryModelProducer(List<ChartModelProducer<Model>> chartModelProducers, Executor backgroundExecutor)
- Parameters:
backgroundExecutor- an Executor used to generate instances of the ComposedChartEntryModel off the main thread.
-
-
Method Detail
-
getChartModelProducers
final List<ChartModelProducer<Model>> getChartModelProducers()
-
getModel
ComposedChartEntryModel<Model> getModel()
Returns the ChartEntryModel for this ChartModelProducer synchronously.
-
progressModel
Unit progressModel(Object key, Float progress)
-
registerForUpdates
Unit registerForUpdates(Object key, Function0<Unit> updateListener, Function0<ComposedChartEntryModel<Model>> getOldModel, Function1<ComposedChartEntryModel<Model>, Unit> onModel)
Registers an update listener associated with a key.
- Parameters:
key- associates a receiver with its listeners.updateListener- is called immediately in this function, and when the ChartModelProducer receives a new list of entries.onModel- called when the ChartModelProducer has generated the Model.
-
unregisterFromUpdates
Unit unregisterFromUpdates(Object key)
Unregisters the update listener associated with the given key.
-
isRegistered
Boolean isRegistered(Object key)
Checks if an update listener with the given key is registered.
-
-
-
-