Class Progress

    • Field Detail

      • decimalFormat

        protected DecimalFormat decimalFormat
        Decimal format
      • max

        protected Integer max
        Max number
      • progress

        protected int progress
        Total progress
      • active

        protected boolean active
        Active flag
      • title

        protected final String title
        Log Title
      • unit

        protected final String unit
        Log Unit
      • countFrequency

        protected int countFrequency
        Log count frequency
      • timeFrequency

        protected int timeFrequency
        Log time frequency, stored in milliseconds
      • localCount

        protected int localCount
        Local count between logs
      • localTime

        protected Date localTime
        Local time between logs
    • Constructor Detail

      • Progress

        public Progress​(String title,
                        int countFrequency,
                        int timeFrequency)
        Constructor
        Parameters:
        title - title
        countFrequency - count frequency
        timeFrequency - time frequency in seconds
      • Progress

        public Progress​(String title,
                        String unit,
                        int countFrequency,
                        int timeFrequency)
        Constructor
        Parameters:
        title - title
        unit - unit
        countFrequency - count frequency
        timeFrequency - time frequency in seconds
        Since:
        3.5.0
    • Method Detail

      • logProgress

        protected void logProgress()
        Log the progress
      • cancel

        public void cancel()
        Cancel the operation
      • getMax

        public Integer getMax()
        Get the max
        Returns:
        max
      • getCountFrequency

        public int getCountFrequency()
        Get the count frequency
        Returns:
        count frequency
        Since:
        3.5.0
      • setCountFrequency

        public void setCountFrequency​(int countFrequency)
        Set the count frequency
        Parameters:
        countFrequency - count frequency
        Since:
        3.5.0
      • getTimeFrequency

        public int getTimeFrequency()
        Get the time frequency in seconds
        Returns:
        time frequency in seconds
        Since:
        3.5.0
      • setTimeFrequency

        public void setTimeFrequency​(int timeFrequency)
        Set the time frequency in seconds
        Parameters:
        timeFrequency - time frequency in seconds
        Since:
        3.5.0
      • getProgress

        public int getProgress()
        Get the total progress
        Returns:
        progress
      • getPercentage

        protected String getPercentage​(int count,
                                       int total)
        Get the string percentage of the count and total
        Parameters:
        count - current count
        total - total count
        Returns:
        string percentage