public final class SimpleDataState extends Object implements AsyncDataState
AsyncDataState with a specific double value as the
state of progress and a string describing the current state.
| Constructor and Description |
|---|
SimpleDataState(String state,
double progress)
Initializes the
SimpleDataState with the specified string
describing the current state of progress and a double value within
the range [0.0, 1.0] describing the estimated numerical state of
progress. |
| Modifier and Type | Method and Description |
|---|---|
double |
getProgress()
Returns the estimated state of progress within the range [0.0, 1.0].
|
String |
getState()
Returns the string describing the current state of progress.
|
String |
toString()
Returns the string representation of this
SimpleDataState in no
particular format. |
public SimpleDataState(String state, double progress)
SimpleDataState with the specified string
describing the current state of progress and a double value within
the range [0.0, 1.0] describing the estimated numerical state of
progress.state - the string describing the current state of progress. This
argument cannot be null.progress - the estimated numerical state of progress within the
range [0.0, 1.0]. The value of this argument is not verified by this
constructor.NullPointerException - thrown if the specified string state is
nullpublic String getState()
null.public double getProgress()
The progress value 0.0 means that the process just started and 1.0 means that it has been completed or very close to being completed.
Note that although this method should return a value within the range [0.0, 1.0], callers should expect any other possible double values (including NaNs) because it is easy to make rounding errors with floating point arithmetic. For values lower than 0.0, callers should assume 0.0 and for values greater than 1.0, they should assume 1.0.
This implementation simply returns the value specified at construction time.
getProgress in interface AsyncDataStatepublic String toString()
SimpleDataState in no
particular format. The string representation contains both estimated
numerical state of progress and the
string describing the state of progress.
This method is intended to be used for debugging only.