Interface ObservableTask

Type Parameters:
R - The type of the value this Task produces.
All Superinterfaces:
Task

public interface ObservableTask extends Task
A Task that notifies its observers when it is finished executing.

Cytoscape Backwards Compatibility (SPI Interface): We expect that this interface will be implemented. Therefore to maintain backwards compatibility this interface will only be modified for major version updates.

Module: work-api

To use this in your app, include the following dependency in your POM:

<dependency>
    <groupId>org.cytoscape</groupId>
    <artifactId>work-api</artifactId>
</dependency>
  • Method Summary

    Modifier and Type
    Method
    Description
    default List<Class<?>>
    Return the classes that can be used to query getResults(Class)
    <R> R
    getResults​(Class<? extends R> type)
    Return the results from this task (if any)

    Methods inherited from interface org.cytoscape.work.Task

    cancel, run
  • Method Details

    • getResults

      <R> R getResults(Class<? extends R> type)
      Return the results from this task (if any)
      Parameters:
      type - the class type of the returned results. This is primarily used to request that the Task format the return as a String, but other types are possible also. All ObservableTasks should be able to handle String requests.
      Returns:
      the Task results, or null if there are no results
    • getResultClasses

      default List<Class<?>> getResultClasses()
      Return the classes that can be used to query getResults(Class)
      Returns:
      the classes that can be used to query getResults(Class)