- All Known Subinterfaces:
public interface TaskFactoryReturns an instance of a
TaskIterator. Intended to be provided and used as an OSGi service. A TaskFactory is a singleton, although each type of
Taskgets its own TaskFactory. For instance, a "load network from file" task will have one TaskFactory and an "apply preferred layout" task will have a different TaskFactory.
Let's say you'd like to do some kind of processing, let's call it "X". Then you would create a class called XTask, where the processing would be taking place in XTask's run() method. Assuming X needs to have two types of data, let's call them Y and Z, in order to control its behavior. This would imply that XTask's constructor should take an Y and a Z as parameters. The XTaskFactory should either be constructed with classes that provide access to Y and Z, or XTaskFactory should be specialized with a different createTaskIterator(Y y, Z z) method. The createTaskIterator method should always be able to fully construct a
TaskIteratorwithout relying on any other mutable state within the TaskFactory.
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>work-api</artifactId> </dependency>
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.
All Methods Instance Methods Abstract Methods Modifier and Type Method Description
createTaskIterator()Returns an iterator containing a sequence of
isReady()Returns true if the TaskFactory has all necessary preconditions needed to generate a task that will execute properly, false otherwise.
TaskIterator createTaskIterator()Returns an iterator containing a sequence of
- an iterator containing a sequence of
- true if the TaskFactory has all necessary preconditions needed to generate a task that will execute properly, false otherwise.