-
- All Implemented Interfaces:
-
com.patrykandpatrick.vico.core.entry.ChartModelProducer
public final class ChartEntryModelProducer implements ChartModelProducer<ChartEntryModel>
A ChartModelProducer implementation that generates ChartEntryModel instances.
-
-
Constructor Summary
Constructors Constructor Description ChartEntryModelProducer(List<ChartEntry> entryCollections, Executor backgroundExecutor, DiffProcessor<ChartEntry> diffProcessor)ChartEntryModelProducer(List<List<ChartEntry>> entryCollections, Executor backgroundExecutor, DiffProcessor<ChartEntry> diffProcessor)
-
Method Summary
Modifier and Type Method Description final UnitsetEntries(List<List<ChartEntry>> entries)Updates the two-dimensional list of ChartEntry instances and notifies listeners about the update. final UnitsetEntries(List<ChartEntry> entries)Updates the two-dimensional list of ChartEntry instances and notifies listeners about the update. ChartEntryModelgetModel()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<ChartEntryModel> getOldModel, Function1<ChartEntryModel, 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
-
ChartEntryModelProducer
ChartEntryModelProducer(List<ChartEntry> entryCollections, Executor backgroundExecutor, DiffProcessor<ChartEntry> diffProcessor)
-
ChartEntryModelProducer
ChartEntryModelProducer(List<List<ChartEntry>> entryCollections, Executor backgroundExecutor, DiffProcessor<ChartEntry> diffProcessor)
- Parameters:
entryCollections- a two-dimensional list of ChartEntry instances used to generate the ChartEntryModel.backgroundExecutor- an Executor used to generate instances of the ChartEntryModel off the main thread.diffProcessor- the DiffProcessor to use for difference animations.
-
-
Method Detail
-
setEntries
final Unit setEntries(List<List<ChartEntry>> entries)
Updates the two-dimensional list of ChartEntry instances and notifies listeners about the update.
-
setEntries
final Unit setEntries(List<ChartEntry> entries)
Updates the two-dimensional list of ChartEntry instances and notifies listeners about the update.
-
getModel
ChartEntryModel getModel()
Returns the ChartEntryModel for this ChartModelProducer synchronously.
-
progressModel
Unit progressModel(Object key, Float progress)
-
registerForUpdates
Unit registerForUpdates(Object key, Function0<Unit> updateListener, Function0<ChartEntryModel> getOldModel, Function1<ChartEntryModel, 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.
-
-
-
-