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
FieldsModifier and TypeFieldDescriptionstatic final TLfnProgressA constant representing unknown progress.static final longConstant indicating the upper bound of a progress is unknown.static final longConstant indicating the elapsed time is unknown.static final longConstant indicating the start time of a progress is unknown.static final longConstant indicating the remaining time of a progress is unknown.static final longConstant indicating the current value of a progress is unknown. -
Constructor Summary
ConstructorsConstructorDescriptionTLfnProgress(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 TypeMethodDescriptionbooleanlongget()Returns the current progress.doubleGets the current progress as a fraction in [0,1].longgetBound()Gets the upper bound of the progress.longGets the total elapsed time in milliseconds.longReturns the time (in milliseconds as defined bySystem.currentTimeMillis()) at which the progress started.longReturns the estimated time left (in milliseconds).inthashCode()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_TIMEwhen not startedaValue- the current progress orUNKNOWN_VALUEif unknownaBound- the upper bound of the progress orUNKNOWN_BOUNDif unknownaTimeLeft- the estimated time left in milliseconds orUNKNOWN_TIME_LEFTwhen 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_TIMEif not startedaValue- the current progress orUNKNOWN_VALUEif unknownaBound- the upper bound of the progress orUNKNOWN_BOUNDif unknownaTimeLeft- the estimated time left in milliseconds orUNKNOWN_TIME_LEFTif unknownaElapsedTime- the elapsed time in milliseconds, orUNKNOWN_ELAPSED_TIMEif unknown
-
-
Method Details
-
get
public long get()Returns the current progress. This is a value in [0,getBound()], orUNKNOWN_VALUEif unknown.- Returns:
- the current progress or
UNKNOWN_VALUEif unknown
-
getBound
public long getBound()Gets the upper bound of the progress.- Returns:
- the upper bound of the progress or
UNKNOWN_BOUNDif unknown
-
getAsFraction
public double getAsFraction()Gets the current progress as a fraction in [0,1].- Returns:
- the current progress as a fraction or
Double.NaNif 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_TIMEif 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_TIMEif unknown
-
getTimeLeft
public long getTimeLeft()Returns the estimated time left (in milliseconds).- Returns:
- the estimated time left in milliseconds or
UNKNOWN_TIME_LEFTif unknown
-
toString
-
equals
-
hashCode
public int hashCode()
-
TLfnProgress(long, long, long, long, long)instead