Class Progress

java.lang.Object
com.sk89q.worldedit.util.task.progress.Progress

public abstract class Progress extends Object
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 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() returns true, the behavior of this method is undefined.

      Returns:
      a number in the range [0, 1]
    • indeterminate

      public static Progress indeterminate()
      Get a static progress object that is indeterminate.
      Returns:
      a progress object
    • completed

      public static Progress completed()
      Get a static progress object that is complete.
      Returns:
      a progress object
    • of

      public static Progress of(double value)
      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

      public static Progress split(Progress... objects)
      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

      public static Progress split(Collection<Progress> progress)
      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

      public static Progress splitObservables(ProgressObservable... observables)
      Create a new progress object with progress split equally between the given ProgressObservables.
      Parameters:
      observables - an array of observables
      Returns:
      a new progress value
    • splitObservables

      public static Progress splitObservables(Collection<? extends ProgressObservable> observables)
      Create a new progress object with progress split equally between the given ProgressObservables.
      Parameters:
      observables - a collection of observables
      Returns:
      a new progress value