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
  • Method Details

    • withLoggerGranularity

      public SimpleProgressionTracker withLoggerGranularity(int loggerGranularity)
      Add a granularity to the tracker
      Parameters:
      loggerGranularity - The granularity
      Returns:
      The tracker
    • complete

      protected void complete()
      Complete the step
    • getIndex

      public long getIndex()
      Description copied from interface: ProgressionTracker
      Get the index of the current step
      Returns:
      The index between [1 and size]
    • getSize

      public long getSize()
      Description copied from interface: ProgressionTracker
      Get the size
      Returns:
      The size
    • setSize

      public void setSize(long size)
      Set the size
      Parameters:
      size - The size wanted
    • increment

      public void increment()
      Increment the progression of 1 increment
    • increment

      public void increment(long increment)
      Increment the progression of 'increment' graduations
      Parameters:
      increment - The number of increment to add
    • asPercentage

      public double asPercentage()
      Description copied from interface: ProgressionTracker
      Get the progression percentage, that can be simply ProgressionTracker.getIndex() / ProgressionTracker.getSize() or a more complex algorithm when handling children progressions
      Returns:
      The progression (between 0 and 100)