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 beincremented
andretrieved
. If a task ends before reaching its next reporting interval theunreported progress
can be retrieve as well.- Author:
- Evren Sirin
-
-
Constructor Summary
Constructors Constructor Description ReportIntervalCounter(long theInterval)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getCount()
Returns current progress count;long
getUnreported()
Returns the unreported progress since last report.boolean
hasUnreported()
Returnstrue
if there is unreported progress.boolean
increment()
Increments the progress counter by one and returnstrue
if report interval has been reached.boolean
increment(long theAmount)
Increments the progress counter by the given amount and returnstrue
if report interval has been reached.-
Methods inherited from class com.complexible.common.base.ReportInterval
computeNextReport, getElapsedTime, getInterval, getNextReport, isReport, setInterval
-
-
-
-
Method Detail
-
getCount
public long getCount()
Returns current progress count;
-
hasUnreported
public boolean hasUnreported()
Returnstrue
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 returnstrue
if report interval has been reached.
-
increment
public boolean increment(long theAmount)
Increments the progress counter by the given amount and returnstrue
if report interval has been reached.
-
-