Class Progress
java.lang.Object
com.sk89q.worldedit.util.task.progress.Progress
A progress object describes the progress of an operation, specifying
either a percentage of completion or a status of indeterminacy.
Progress objects are immutable.
To create a new instance, use one of the static constructors on this class.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Progress
Get a static progress object that is complete.abstract double
Get the progress percentage.static Progress
Get a static progress object that is indeterminate.abstract boolean
Return whether the current progress is indeterminate.static Progress
of
(double value) Create a new progress object with the given percentage.static Progress
Create a new progress object with progress split equally between the given progress objects.static Progress
split
(Collection<Progress> progress) Create a new progress object with progress split equally between the given progress objects.static Progress
splitObservables
(ProgressObservable... observables) Create a new progress object with progress split equally between the givenProgressObservable
s.static Progress
splitObservables
(Collection<? extends ProgressObservable> observables) Create a new progress object with progress split equally between the givenProgressObservable
s.
-
Method Details
-
isIndeterminate
public abstract boolean isIndeterminate()Return whether the current progress is indeterminate.- Returns:
- true if indeterminate
-
getProgress
public abstract double getProgress()Get the progress percentage.If
isIndeterminate()
returnstrue
, the behavior of this method is undefined.- Returns:
- a number in the range [0, 1]
-
indeterminate
Get a static progress object that is indeterminate.- Returns:
- a progress object
-
completed
Get a static progress object that is complete.- Returns:
- a progress object
-
of
Create a new progress object with the given percentage.- Parameters:
value
- the percentage, which will be clamped to [0, 1]- Returns:
- a progress object
-
split
Create a new progress object with progress split equally between the given progress objects.- Parameters:
objects
- an array of progress objects- Returns:
- a new progress value
-
split
Create a new progress object with progress split equally between the given progress objects.- Parameters:
progress
- a collection of progress objects- Returns:
- a new progress value
-
splitObservables
Create a new progress object with progress split equally between the givenProgressObservable
s.- Parameters:
observables
- an array of observables- Returns:
- a new progress value
-
splitObservables
Create a new progress object with progress split equally between the givenProgressObservable
s.- Parameters:
observables
- a collection of observables- Returns:
- a new progress value
-