|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tranche.commons.Debuggable
org.tranche.timeestimator.TimeEstimator
org.tranche.timeestimator.ContextualTimeEstimator
public class ContextualTimeEstimator
Estimated remaining time depends on performance in last n seconds.
Subclass of TimeEstimator, falls back on TimeEstimator until first window completed.
| Field Summary | |
|---|---|
protected static int |
HOUR
|
protected static int |
MINUTE
|
protected static int |
SECOND
|
| Fields inherited from class org.tranche.timeestimator.TimeEstimator |
|---|
bytesCompleted, currentTime, filesCompleted, startTime, totalBytes, totalFiles |
| Constructor Summary | |
|---|---|
ContextualTimeEstimator()
|
|
ContextualTimeEstimator(long bytesCompleted,
long totalBytes,
long totalFilesCompleted,
long totalFiles)
|
|
| Method Summary | |
|---|---|
int |
getContextInterval()
Returns the length of each context window used for estimating time remaining. |
long |
getHours()
Get the number of hours the estimator has been running. |
long |
getMinutes()
Get the number of minutes the estimator has been running. |
long |
getSeconds()
Get the number of seconds the estimator has been running. |
void |
setContextInterval(int milliseconds)
Set the sample context window duration for determining progress. |
void |
update(long totalBytesCompleted,
long totalBytes,
long totalFilesCompleted,
long totalFiles)
Submit new data to the time estimator. |
| Methods inherited from class org.tranche.timeestimator.TimeEstimator |
|---|
addTotalBytes, addTotalFiles, getBytesDone, getFilesDone, getPercentDone, getStartTime, getTimeLeftString, getTimeRunning, getTotalBytes, getTotalFiles, subtractTotalBytes, subtractTotalFiles |
| Methods inherited from class org.tranche.commons.Debuggable |
|---|
debugErr, debugErr, debugOut, isDebug, setDebug |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int SECOND
protected static final int MINUTE
protected static final int HOUR
| Constructor Detail |
|---|
public ContextualTimeEstimator()
public ContextualTimeEstimator(long bytesCompleted,
long totalBytes,
long totalFilesCompleted,
long totalFiles)
bytesCompleted - totalBytes - | Method Detail |
|---|
public void update(long totalBytesCompleted,
long totalBytes,
long totalFilesCompleted,
long totalFiles)
Submit new data to the time estimator. Used to update the estimator.
update in class TimeEstimatortotalBytesCompleted - totalBytes - public long getHours()
Get the number of hours the estimator has been running.
getHours in class TimeEstimatorpublic long getMinutes()
Get the number of minutes the estimator has been running.
getMinutes in class TimeEstimatorpublic long getSeconds()
Get the number of seconds the estimator has been running.
getSeconds in class TimeEstimatorpublic int getContextInterval()
Returns the length of each context window used for estimating time remaining.
public void setContextInterval(int milliseconds)
Set the sample context window duration for determining progress. Every context window, data transfered is measured and used to estimate time remaining.
E.g., if set to 30 seconds, every 30 seconds a new performance measurement is completed and used to estimate the time remaining for the next 30 seconds.
milliseconds - The time in milliseconds of each window.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||