|
Cytoscape 3.0.0-alpha8-SNAPSHOT API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cytoscape.work.AbstractTask
org.cytoscape.io.write.AbstractCyWriter<T>
T - Generic type that extends CyWriterManager.public abstract class AbstractCyWriter<T extends CyWriterManager>
An abstract utility implementation of a Task that writes a user defined
file to a file type determined by a provided writer manager. This class
is meant to be extended for specific file types such that the appropriate
CyWriter can be identified.
| Field Summary | |
|---|---|
protected Map<String,CyFileFilter> |
descriptionFilterMap
A Map that maps description strings to CyFileFilters |
protected File |
outputFile
The file to be written. |
protected T |
writerManager
The CyWriterManager specified in the constructor. |
| Fields inherited from class org.cytoscape.work.AbstractTask |
|---|
cancelled |
| Constructor Summary | |
|---|---|
AbstractCyWriter(T writerManager)
Constructor. |
|
| Method Summary | |
|---|---|
protected abstract String |
getExportFileFormat()
An implementation of this method should return a file format description from CyFileFilter, such that the string can be found in the descriptionFilterMap. |
File |
getOutputFile()
This method gets the file to be written. |
protected abstract CyWriter |
getWriter(CyFileFilter filter,
File out)
Should return a CyWriter object for writing the specified file of the specified type. |
void |
run(TaskMonitor tm)
This method processes the chosen input file and output type and attempts to write the file. |
void |
setOutputFile(File f)
The method sets the file to be written. |
| Methods inherited from class org.cytoscape.work.AbstractTask |
|---|
cancel, insertTasksAfterCurrentTask, insertTasksAfterCurrentTask, setTaskIterator |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.cytoscape.work.Task |
|---|
cancel |
| Field Detail |
|---|
protected File outputFile
protected final Map<String,CyFileFilter> descriptionFilterMap
CyFileFilters
protected final T extends CyWriterManager writerManager
| Constructor Detail |
|---|
public AbstractCyWriter(T writerManager)
writerManager - The CyWriterManager to be used to determine which
CyWriter to be used to write the file chosen by the user.| Method Detail |
|---|
public final void setOutputFile(File f)
Tunable
processing. This method is the "setter" portion of a
getter/setter tunable method pair.
f - The file to be written.public File getOutputFile()
Tunable
processing. This method is the "getter" portion of a
getter/setter tunable method pair.
protected abstract String getExportFileFormat()
CyFileFilter, such that the string can be found in the descriptionFilterMap.
CyFileFilter.
public final void run(TaskMonitor tm)
throws Exception
run in interface Taskrun in class AbstractTasktm - The TaskMonitor provided by the TaskManager execution environment.
Exception - The Task is at liberty to
throw an exception in run. The exception is
caught by TaskManager and is displayed in the interface.
If a Task does not throw an exception,
the Task implementation does not
need to specify the throws Exception clause
for the run method. Moreover, exceptions
should be the way the Task communicates
the occurrence of a fatal error, like a low-level exception or an invalid parameter,
to the TaskManager.
protected abstract CyWriter getWriter(CyFileFilter filter,
File out)
throws Exception
CyWriter object for writing the specified file of the specified type.
filter - The specific type of file to be written.out - The file that will be written.
CyWriter object for writing the specified file of the specified type.
Exception
|
Cytoscape 3.0.0-alpha8-SNAPSHOT API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||