Class AbstractProgress

  • All Implemented Interfaces:
    Progress
    Direct Known Subclasses:
    EntityProgressProperty.ProgressImpl

    public abstract class AbstractProgress
    extends java.lang.Object
    implements Progress
    Progress Implementation base. A module, representing a workload, can create a number of child modules.
    Since:
    1.2
    • Constructor Detail

      • AbstractProgress

        public AbstractProgress()
        Create a progress with root module.
    • Method Detail

      • startChildModule

        public Progress.Module startChildModule​(int percentage)
        Description copied from interface: Progress
        Start a child module. After the child module is created, it becomes active module.
        Specified by:
        startChildModule in interface Progress
        Parameters:
        percentage - the child module workload percentage of the current module.
        Returns:
        a Progress module
      • completeChildModule

        public void completeChildModule​(Progress.Module module)
        Description copied from interface: Progress
        Complete the current active child module
        Specified by:
        completeChildModule in interface Progress
        Parameters:
        module - active child module
      • startNextChildModule

        public Progress.Module startNextChildModule​(Progress.Module module,
                                                    int percentage)
        Description copied from interface: Progress
        Complete the current active child module, and start next child module.
        Specified by:
        startNextChildModule in interface Progress
        Parameters:
        module - the current active module
        percentage - the percentage of the next module workload among its sibling modules
        Returns:
        the next module started
      • addModulePercentageCompleted

        public void addModulePercentageCompleted​(double percentageToAdd)
        Add work percentage completed to the active module.
        Specified by:
        addModulePercentageCompleted in interface Progress
        Parameters:
        percentageToAdd - 0 to 100
      • done

        public void done()
        Set root module completed percentage.
        Specified by:
        done in interface Progress
      • addProgressListener

        public void addProgressListener​(ProgressListener listener)
        Description copied from interface: Progress
        Add progress listener.
        Specified by:
        addProgressListener in interface Progress
        Parameters:
        listener - the listener to add
      • logMessage

        public static void logMessage​(org.slf4j.Logger logger,
                                      org.slf4j.event.Level level,
                                      java.lang.String message)
        Log message using the logger.
        Parameters:
        logger - logger
        level - log level
        message - the message to log
        Since:
        5.9