JAL-3878 Add getCalcName to AlignCalcWorkerI.
[jalview.git] / src / jalview / api / AlignCalcWorkerI.java
index 85157c4..19df53f 100644 (file)
  */
 package jalview.api;
 
+import java.util.concurrent.Callable;
+
 import jalview.datamodel.AlignmentAnnotation;
 
 /**
  * Interface describing a worker that calculates alignment annotation(s). The
  * main (re-)calculation should be performed by the inherited run() method.
  */
-public interface AlignCalcWorkerI extends Runnable
+public interface AlignCalcWorkerI
 {
   /**
+   * Returns the name of this calculation used to identify the service running
+   * this worker.
+   * 
+   * @return calculator name
+   */
+  public default String getCalcName()
+  {
+    return null;
+  }
+
+  /**
    * Answers true if this worker updates the given annotation (regardless of its
    * current state)
    * 
@@ -39,8 +52,8 @@ public interface AlignCalcWorkerI extends Runnable
 
   /**
    * Updates the display of calculated annotation values (does not recalculate
-   * the values). This allows ßquick redraw of annotations when display settings
-   * are changed.
+   * the values). This allows a quick redraw of annotations when display
+   * settings are changed.
    */
   void updateAnnotation();
 
@@ -50,6 +63,13 @@ public interface AlignCalcWorkerI extends Runnable
   void removeAnnotation();
 
   /**
+   * The main calculation happens here
+   * 
+   * @throws Throwable
+   */
+  public void run() throws Throwable;
+
+  /**
    * Answers true if the worker should be deleted entirely when its annotation
    * is deleted from the display, or false if it should continue to run. Some
    * workers are required to run for their side-effects.