Package com.complexible.common.base
Class ReportIntervalCounter
java.lang.Object
com.complexible.common.base.ReportInterval
com.complexible.common.base.ReportIntervalCounter
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 -
Method Summary
Modifier and TypeMethodDescriptionlonggetCount()Returns current progress count;longReturns the unreported progress since last report.booleanReturnstrueif there is unreported progress.booleanIncrements 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
-
Constructor Details
-
ReportIntervalCounter
public ReportIntervalCounter(long theInterval)
-
-
Method Details
-
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.
-