Class SimpleProgressionTracker
java.lang.Object
org.ametys.core.schedule.progression.AbstractProgressionTracker
org.ametys.core.schedule.progression.SimpleProgressionTracker
- All Implemented Interfaces:
ProgressionTracker
Simple implementation that tracks a progression with graduations
-
Field Summary
Fields inherited from class org.ametys.core.schedule.progression.AbstractProgressionTracker
_factory, _label, _parent -
Method Summary
Modifier and TypeMethodDescriptiondoubleGet the progression percentage, that can be simplyProgressionTracker.getIndex()/ProgressionTracker.getSize()or a more complex algorithm when handling children progressionsprotected voidcomplete()Complete the steplonggetIndex()Get the index of the current steplonggetSize()Get the sizevoidIncrement the progression of 1 incrementvoidincrement(long increment) Increment the progression of 'increment' graduationsvoidsetSize(long size) Set the sizewithLoggerGranularity(int loggerGranularity) Add a granularity to the trackerMethods inherited from class org.ametys.core.schedule.progression.AbstractProgressionTracker
_getHierarchicalLabel, _getLogger, _getLogPrefix, getId, getLabel, getParent, toJSON
-
Method Details
-
withLoggerGranularity
Add a granularity to the tracker- Parameters:
loggerGranularity- The granularity- Returns:
- The tracker
-
complete
Complete the step -
getIndex
Description copied from interface:ProgressionTrackerGet the index of the current step- Returns:
- The index between [1 and size]
-
getSize
Description copied from interface:ProgressionTrackerGet the size- Returns:
- The size
-
setSize
Set the size- Parameters:
size- The size wanted
-
increment
Increment the progression of 1 increment -
increment
Increment the progression of 'increment' graduations- Parameters:
increment- The number of increment to add
-
asPercentage
Description copied from interface:ProgressionTrackerGet the progression percentage, that can be simplyProgressionTracker.getIndex()/ProgressionTracker.getSize()or a more complex algorithm when handling children progressions- Returns:
- The progression (between 0 and 100)
-