Package com.luciad.fusion.util
Class TLfnProgress
java.lang.Object
com.luciad.fusion.util.TLfnProgress
A snapshot of the progress of a process.
- Since:
- 10.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final TLfnProgress
A constant representing unknown progress.static final long
Constant indicating the upper bound of a progress is unknown.static final long
Constant indicating the elapsed time is unknown.static final long
Constant indicating the start time of a progress is unknown.static final long
Constant indicating the remaining time of a progress is unknown.static final long
Constant indicating the current value of a progress is unknown. -
Constructor Summary
ConstructorDescriptionTLfnProgress
(long aStartTime, long aValue, long aBound, long aTimeLeft) Deprecated.TLfnProgress
(long aStartTime, long aValue, long aBound, long aTimeLeft, long aElapsedTime) Constructs a new progress snapshot. -
Method Summary
Modifier and TypeMethodDescriptionboolean
long
get()
Returns the current progress.double
Gets the current progress as a fraction in [0,1].long
getBound()
Gets the upper bound of the progress.long
Gets the total elapsed time in milliseconds.long
Returns the time (in milliseconds as defined bySystem.currentTimeMillis()
) at which the progress started.long
Returns the estimated time left (in milliseconds).int
hashCode()
toString()
-
Field Details
-
UNKNOWN_START_TIME
public static final long UNKNOWN_START_TIMEConstant indicating the start time of a progress is unknown.- See Also:
-
UNKNOWN_ELAPSED_TIME
public static final long UNKNOWN_ELAPSED_TIMEConstant indicating the elapsed time is unknown.- See Also:
-
UNKNOWN_TIME_LEFT
public static final long UNKNOWN_TIME_LEFTConstant indicating the remaining time of a progress is unknown.- See Also:
-
UNKNOWN_VALUE
public static final long UNKNOWN_VALUEConstant indicating the current value of a progress is unknown.- See Also:
-
UNKNOWN_BOUND
public static final long UNKNOWN_BOUNDConstant indicating the upper bound of a progress is unknown.- See Also:
-
UNKNOWN
A constant representing unknown progress. It is initialized with the following values:- start time:
UNKNOWN_START_TIME
- value:
UNKNOWN_VALUE
- bound:
UNKNOWN_BOUND
- time left:
UNKNOWN_TIME_LEFT
- Since:
- 11.0
- start time:
-
-
Constructor Details
-
TLfnProgress
Deprecated.UseTLfnProgress(long, long, long, long, long)
insteadConstructs a new progress snapshot.- Parameters:
aStartTime
- the time in milliseconds since epoch at which the progress started orUNKNOWN_START_TIME
when not startedaValue
- the current progress orUNKNOWN_VALUE
if unknownaBound
- the upper bound of the progress orUNKNOWN_BOUND
if unknownaTimeLeft
- the estimated time left in milliseconds orUNKNOWN_TIME_LEFT
when unknown
-
TLfnProgress
public TLfnProgress(long aStartTime, long aValue, long aBound, long aTimeLeft, long aElapsedTime) Constructs a new progress snapshot.- Parameters:
aStartTime
- the time in milliseconds since epoch at which the progress started orUNKNOWN_START_TIME
if not startedaValue
- the current progress orUNKNOWN_VALUE
if unknownaBound
- the upper bound of the progress orUNKNOWN_BOUND
if unknownaTimeLeft
- the estimated time left in milliseconds orUNKNOWN_TIME_LEFT
if unknownaElapsedTime
- the elapsed time in milliseconds, orUNKNOWN_ELAPSED_TIME
if unknown
-
-
Method Details
-
get
public long get()Returns the current progress. This is a value in [0,getBound()
], orUNKNOWN_VALUE
if unknown.- Returns:
- the current progress or
UNKNOWN_VALUE
if unknown
-
getBound
public long getBound()Gets the upper bound of the progress.- Returns:
- the upper bound of the progress or
UNKNOWN_BOUND
if unknown
-
getAsFraction
public double getAsFraction()Gets the current progress as a fraction in [0,1].- Returns:
- the current progress as a fraction or
Double.NaN
if unknown
-
getStartTime
public long getStartTime()Returns the time (in milliseconds as defined bySystem.currentTimeMillis()
) at which the progress started. If the job was stopped and restarted multiple times, the time of the last restart will be reflected.- Returns:
- the time at which the progress started or
UNKNOWN_START_TIME
if not started
-
getElapsedTime
public long getElapsedTime()Gets the total elapsed time in milliseconds. If the job has been stopped and restarted multiple times, the elapsed time will reflect the total runtime. The elapsed time survives job restarts and system restarts.- Returns:
- the total elapsed time in milliseconds (runtime) or
UNKNOWN_ELAPSED_TIME
if unknown
-
getTimeLeft
public long getTimeLeft()Returns the estimated time left (in milliseconds).- Returns:
- the estimated time left in milliseconds or
UNKNOWN_TIME_LEFT
if unknown
-
toString
-
equals
-
hashCode
public int hashCode()
-
TLfnProgress(long, long, long, long, long)
instead