Class Task.WorkCounters

  • Enclosing class:
    Task

    public static final class Task.WorkCounters
    extends Object
    Data holder for work counters.
    • total number of elements to process,
    • number of elements processed / done / completed,
    • number of elements unprocessed / left to do
    • Constructor Detail

      • WorkCounters

        public WorkCounters()
        Initializes work counters to a total of zero.
      • WorkCounters

        public WorkCounters​(long totalCount)
        Initializes work counters to the provided total.
        Parameters:
        totalCount - the total count
    • Method Detail

      • setTotalCount

        public void setTotalCount​(long totalCount)
        Sets the total count, and resets the number of elements done to 0.
        Parameters:
        totalCount - the total count
      • completed

        public void completed​(long deltaDone)
        Updates the number of elements done by adding the provided delta.
        Parameters:
        deltaDone - the additional number of elements done.
      • getTotalCount

        public long getTotalCount()
        Returns the total number of elements to process.
        Returns:
        the total number of elements to process
      • getTodoCount

        public long getTodoCount()
        Returns the number of entries that remain to be processed.
        Returns:
        the number of entries that remain to be processed
      • getDoneCount

        public long getDoneCount()
        Returns the number of entries that have been processed so far.
        Returns:
        the number of entries that have been processed so far