Class AbstractIOTask

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean canceled
      indicates whether the task has been canceled
      private boolean failed
      indicates whether the task has been failed
      private java.lang.Exception lastException
      the last exception caught
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractIOTask()
      Constructs a new AbstractIOTask.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void cancel()
      Cancel the task
      java.lang.Exception getLastException()
      Replies the last exception caught
      boolean isCanceled()
      Replies true if the task has been canceled
      boolean isFailed()
      Replies true if the task has been failed
      boolean isSuccessful()
      Replies true if this task was successful, i.e.
      protected void setCanceled​(boolean canceled)
      Set whether this task has been canceled
      protected void setFailed​(boolean failed)
      Sets whether the task has been failed
      protected void setLastException​(java.lang.Exception lastException)
      Sets the last exception caught
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Runnable

        run
    • Field Detail

      • canceled

        private boolean canceled
        indicates whether the task has been canceled
      • failed

        private boolean failed
        indicates whether the task has been failed
      • lastException

        private java.lang.Exception lastException
        the last exception caught
    • Constructor Detail

      • AbstractIOTask

        protected AbstractIOTask()
        Constructs a new AbstractIOTask.
    • Method Detail

      • isCanceled

        public boolean isCanceled()
        Replies true if the task has been canceled
        Returns:
        true if the task has been canceled
      • setCanceled

        protected void setCanceled​(boolean canceled)
        Set whether this task has been canceled
        Parameters:
        canceled - true, if the task has been canceled; false otherwise
      • isFailed

        public boolean isFailed()
        Replies true if the task has been failed
        Returns:
        true if the task has been failed
      • setFailed

        protected void setFailed​(boolean failed)
        Sets whether the task has been failed
        Parameters:
        failed - whether the task has been failed
      • getLastException

        public java.lang.Exception getLastException()
        Replies the last exception caught
        Returns:
        the last exception caught; null, if no exception was caught
      • setLastException

        protected void setLastException​(java.lang.Exception lastException)
        Sets the last exception caught
        Parameters:
        lastException - the last exception
      • isSuccessful

        public boolean isSuccessful()
        Replies true if this task was successful, i.e. if it wasn't canceled and didn't fail
        Returns:
        true if this task was successful
      • cancel

        public abstract void cancel()
        Cancel the task