Package org.cytoscape.work
Interface TaskFactory
-
- All Known Subinterfaces:
ExportSelectedNetworkTaskFactory
,ExportSelectedTableTaskFactory
,ExportVizmapTaskFactory
,LoadMultipleNetworkFilesTaskFactory
,LoadNetworkFileTaskFactory
,LoadNetworkURLTaskFactory
,LoadTableFileTaskFactory
,LoadTableURLTaskFactory
,LoadVizmapFileTaskFactory
,MergeTablesTaskFactory
,NetworkSearchTaskFactory
,NewSessionTaskFactory
,OpenSessionTaskFactory
,SaveSessionAsTaskFactory
,SaveSessionTaskFactory
- All Known Implementing Classes:
AbstractNetworkSearchTaskFactory
,AbstractTaskFactory
public interface TaskFactory
Returns an instance of aTaskIterator
. Intended to be provided and used as an OSGi service. A TaskFactory is a singleton, although each type ofTask
gets 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 aTaskIterator
without relying on any other mutable state within the TaskFactory.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>
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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TaskIterator
createTaskIterator()
Returns an iterator containing a sequence ofTask
s.boolean
isReady()
Returns true if the TaskFactory has all necessary preconditions needed to generate a task that will execute properly, false otherwise.
-
-
-
Method Detail
-
createTaskIterator
TaskIterator createTaskIterator()
Returns an iterator containing a sequence ofTask
s.- Returns:
- an iterator containing a sequence of
Task
s.
-
isReady
boolean isReady()
Returns true if the TaskFactory has all necessary preconditions needed to generate a task that will execute properly, false otherwise.- Returns:
- true if the TaskFactory has all necessary preconditions needed to generate a task that will execute properly, false otherwise.
-
-