Package com.complexible.common.base

# Class ReportIntervalCounter

java.lang.Object
com.complexible.common.base.ReportInterval
com.complexible.common.base.ReportIntervalCounter

public class ReportIntervalCounter extends ReportInterval
A report interval extension that also handles tracking progress. The progress can be `incremented` and `retrieved`. If a task ends before reaching its next reporting interval the `unreported progress` can be retrieve as well.

Author:
  Evren Sirin

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ReportIntervalCounter(long theInterval)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long`
  `getCount()`
  Returns current progress count;
  `long`
  `getUnreported()`
  Returns the unreported progress since last report.
  `boolean`
  `hasUnreported()`
  Returns `true` if there is unreported progress.
  `boolean`
  `increment()`
  Increments the progress counter by one and returns `true` if report interval has been reached.
  `boolean`
  `increment(long theAmount)`
  Increments the progress counter by the given amount and returns `true` if report interval has been reached.

  ### Methods inherited from class com.complexible.common.base.ReportInterval

  `computeNextReport, getElapsedTime, getInterval, getNextReport, isReport, setInterval`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ReportIntervalCounter

    public ReportIntervalCounter(long theInterval)

- ## Method Details

  - ### getCount

    public long getCount()
    Returns current progress count;

  - ### hasUnreported

    public boolean hasUnreported()
    Returns `true` if there is unreported progress.

  - ### getUnreported

    public long getUnreported()
    Returns the unreported progress since last report.

  - ### increment

    public boolean increment()
    Increments the progress counter by one and returns `true` if report interval has been reached.

  - ### increment

    public boolean increment(long theAmount)
    Increments the progress counter by the given amount and returns `true` if report interval has been reached.