org.cytoscape.work
Interface TaskFactory
- All Known Subinterfaces:
- ExportSelectedTableTaskFactory, ExportVizmapTaskFactory, LoadNetworkFileTaskFactory, LoadNetworkURLTaskFactory, LoadTableFileTaskFactory, LoadTableURLTaskFactory, LoadVizmapFileTaskFactory, MapGlobalToLocalTableTaskFactory, NewSessionTaskFactory, OpenSessionTaskFactory, SaveSessionAsTaskFactory
- All Known Implementing Classes:
- AbstractTaskFactory
public interface TaskFactory
Returns an instance of a TaskIterator
. Intended to be
used as an OSGi service, singleton, every type of Task
has one.
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 X and a Y as parameters. And XTaskFactory
should have setY() and setZ() methods. XTaskFactory's createTaskIterator() method would then construct
an XTask with the Y and Z that it has available and create a TaskIterator
with this single Task to
iterate over.
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.
createTaskIterator
TaskIterator createTaskIterator()
- Returns an iterator returning a sequence of
Task
s.
- Returns:
- an iterator returning a sequence of
Task
s.
Note: Most factory's returned iterator only yields a single Task
.
isReady
boolean isReady()
Copyright 2011 Cytoscape Consortium. All rights reserved.