Class SimpleProgressStatus

java.lang.Object
com.nomagic.task.SimpleProgressStatus
All Implemented Interfaces:
ProgressStatus

@OpenApiAll public class SimpleProgressStatus extends Object implements ProgressStatus
  • Constructor Details

    • SimpleProgressStatus

      public SimpleProgressStatus()
    • SimpleProgressStatus

      public SimpleProgressStatus(long min, long max, String description)
  • Method Details

    • setMin

      public void setMin(long min)
      Description copied from interface: ProgressStatus
      Set progress minimum value.
      Specified by:
      setMin in interface ProgressStatus
      Parameters:
      min - minimum value
    • setMax

      public void setMax(long max)
      Description copied from interface: ProgressStatus
      Set progress maximum value.
      Specified by:
      setMax in interface ProgressStatus
      Parameters:
      max - maximum value
    • setCurrent

      public void setCurrent(long cur)
      Description copied from interface: ProgressStatus
      Set progress current value.
      Specified by:
      setCurrent in interface ProgressStatus
      Parameters:
      cur - current value
    • getMin

      public long getMin()
      Description copied from interface: ProgressStatus
      Get progress minimum value.
      Specified by:
      getMin in interface ProgressStatus
      Returns:
      minimum value
    • getMax

      public long getMax()
      Description copied from interface: ProgressStatus
      Get progress maximum value.
      Specified by:
      getMax in interface ProgressStatus
      Returns:
      maximum value
    • reset

      public void reset()
      Description copied from interface: ProgressStatus
      Reset progress status.
      Specified by:
      reset in interface ProgressStatus
    • getPercentage

      public int getPercentage()
      Description copied from interface: ProgressStatus
      Get completed percentage.
      Specified by:
      getPercentage in interface ProgressStatus
      Returns:
      completed percentage
    • getDescription

      public String getDescription()
      Description copied from interface: ProgressStatus
      Get progress description.
      Specified by:
      getDescription in interface ProgressStatus
      Returns:
      progress description
    • setDescription

      public void setDescription(String description)
      Description copied from interface: ProgressStatus
      Set progress description.
      Specified by:
      setDescription in interface ProgressStatus
      Parameters:
      description - progress description
    • increase

      public void increase()
      Description copied from interface: ProgressStatus
      Increment progress current value.
      Specified by:
      increase in interface ProgressStatus
    • getCurrent

      public long getCurrent()
      Description copied from interface: ProgressStatus
      Get current progress value.
      Specified by:
      getCurrent in interface ProgressStatus
      Returns:
      current value
    • isCompleted

      public boolean isCompleted()
      Description copied from interface: ProgressStatus
      Checks if progress status completed.
      Specified by:
      isCompleted in interface ProgressStatus
      Returns:
      true when progress status completed
    • setIndeterminate

      public void setIndeterminate(boolean ind)
      Description copied from interface: ProgressStatus
      Set progress status as indeterminate.
      Specified by:
      setIndeterminate in interface ProgressStatus
      Parameters:
      ind - true for progress status as indeterminate.
    • isIndeterminate

      public boolean isIndeterminate()
      Description copied from interface: ProgressStatus
      Checks if progres status is indeterminate,
      Specified by:
      isIndeterminate in interface ProgressStatus
      Returns:
      true when progress status as indeterminate.
    • setLocked

      public void setLocked(boolean lock)
      Description copied from interface: ProgressStatus
      Lock the progress status. Locked status does not change progress value.
      Specified by:
      setLocked in interface ProgressStatus
      Parameters:
      lock - true for progress status locking.
    • isLocked

      public boolean isLocked()
      Description copied from interface: ProgressStatus
      Check if progress status is locked.
      Specified by:
      isLocked in interface ProgressStatus
      Returns:
      true when progress status is locked.
    • init

      public void init(String description, long min, long max, long cur)
      Description copied from interface: ProgressStatus
      Initialize progress.
      Specified by:
      init in interface ProgressStatus
      Parameters:
      description - progress description.
      min - minimum value.
      max - maximum value.
      cur - current value.
    • init

      public void init(String description, long min, long max)
      Description copied from interface: ProgressStatus
      Initialize progress.
      Specified by:
      init in interface ProgressStatus
      Parameters:
      description - progress description.
      min - minimum value.
      max - maximum value.
    • init

      public void init(String description, long max)
      Description copied from interface: ProgressStatus
      Initialize progress.
      Specified by:
      init in interface ProgressStatus
      Parameters:
      description - progress description.
      max - maximum value.
    • isCancel

      public boolean isCancel()
      Specified by:
      isCancel in interface ProgressStatus
      Returns:
      true if current operation is requested to be canceled.
    • setCancel

      public void setCancel(boolean cancel)
      Description copied from interface: ProgressStatus
      Call this when want current operation be canceled. Actual operation can not support cancel.
      Specified by:
      setCancel in interface ProgressStatus
      Parameters:
      cancel - new cancel value.