Cytoscape 3.0.1 API

org.cytoscape.work
Interface TaskFactory

All Known Subinterfaces:
ExportSelectedTableTaskFactory, ExportVizmapTaskFactory, LoadNetworkFileTaskFactory, LoadNetworkURLTaskFactory, LoadTableFileTaskFactory, LoadTableURLTaskFactory, LoadVizmapFileTaskFactory, NewSessionTaskFactory, OpenSessionTaskFactory, SaveSessionAsTaskFactory, SaveSessionTaskFactory
All Known Implementing Classes:
AbstractTaskFactory

public interface TaskFactory

Returns an instance of a TaskIterator. Intended to be provided and used as an OSGi service. A TaskFactory is a singleton, although each type of Task 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 a TaskIterator without relying on any other mutable state within the TaskFactory.


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
 TaskIterator createTaskIterator()
          Returns an iterator containing a sequence of Tasks.
 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 of Tasks.

Returns:
an iterator containing a sequence of Tasks.

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.

Cytoscape 3.0.1 API

Copyright 2011 Cytoscape Consortium. All rights reserved.