Interface Operation

All Superinterfaces:
Runnable
All Known Implementing Classes:
AbstractOperation, AbstractReadWriteLockOperation, RunnableOperation

public interface Operation extends Runnable
Represents some operation that can be executed. In essence this class is a lightweight task encapsulation. The operation can be canceled, which prevents its execution if execution has not yet started. Operation execution is initiated by a call to Runnable.run().
Author:
Garret Wilson
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Cancels the operation.
    boolean
     

    Methods inherited from interface java.lang.Runnable

    run
  • Method Details

    • cancel

      void cancel()
      Cancels the operation. If called before execution has started, the operation will not execute.
    • isCanceled

      boolean isCanceled()
      Returns:
      Whether this operation has been canceled and should not execute.