Class SimpleProgressStatus

  • All Implemented Interfaces:
    ProgressStatus

    @OpenApiAll
    public class SimpleProgressStatus
    extends java.lang.Object
    implements ProgressStatus
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getCurrent()
      Get current progress value.
      java.lang.String getDescription()
      Get progress description.
      long getMax()
      Get progress maximum value.
      long getMin()
      Get progress minimum value.
      int getPercentage()
      Get completed percentage.
      void increase()
      Increment progress current value.
      void init​(java.lang.String description, long max)
      Initialize progress.
      void init​(java.lang.String description, long min, long max)
      Initialize progress.
      void init​(java.lang.String description, long min, long max, long cur)
      Initialize progress.
      boolean isCancel()  
      boolean isCompleted()
      Checks if progress status completed.
      boolean isIndeterminate()
      Checks if progres status is indeterminate,
      boolean isLocked()
      Check if progress status is locked.
      void reset()
      Reset progress status.
      void setCancel​(boolean cancel)
      Call this when want current operation be canceled.
      void setCurrent​(long cur)
      Set progress current value.
      void setDescription​(java.lang.String description)
      Set progress description.
      void setIndeterminate​(boolean ind)
      Set progress status as indeterminate.
      void setLocked​(boolean lock)
      Lock the progress status.
      void setMax​(long max)
      Set progress maximum value.
      void setMin​(long min)
      Set progress minimum value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • min

        private long min
      • max

        private long max
      • cur

        private long cur
      • mDescription

        private java.lang.String mDescription
      • isLocked

        private boolean isLocked
      • indeterminate

        private boolean indeterminate
      • mCancel

        private volatile boolean mCancel
    • Constructor Detail

      • SimpleProgressStatus

        public SimpleProgressStatus()
      • SimpleProgressStatus

        public SimpleProgressStatus​(long min,
                                    long max,
                                    java.lang.String description)
    • Method Detail

      • setMin

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

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

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

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

        public void setDescription​(java.lang.String description)
        Description copied from interface: ProgressStatus
        Set progress description.
        Specified by:
        setDescription in interface ProgressStatus
      • isCompleted

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

        public boolean isIndeterminate()
        Description copied from interface: ProgressStatus
        Checks if progres status is indeterminate,
        Specified by:
        isIndeterminate in interface ProgressStatus
        Returns:
      • 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
      • isLocked

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

        public void init​(java.lang.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​(java.lang.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​(java.lang.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.