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 beincrementedandretrieved. If a task ends before reaching its next reporting interval theunreported progresscan 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 longgetCount()Returns current progress count;longgetUnreported()Returns the unreported progress since last report.booleanhasUnreported()Returnstrueif there is unreported progress.booleanincrement()Increments the progress counter by one and returnstrueif report interval has been reached.booleanincrement(long theAmount)Increments the progress counter by the given amount and returnstrueif 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()
Returnstrueif 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 returnstrueif report interval has been reached.
-
increment
public boolean increment(long theAmount)
Increments the progress counter by the given amount and returnstrueif report interval has been reached.
-
-