public abstract class AbstractModule extends Object implements Module
Module implementations.
By default, input and output values are stored in HashMaps.
| Constructor and Description |
|---|
AbstractModule() |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Performs necessary cleanup in response to cancellation of the module
execution.
|
Object |
getDelegateObject()
Gets the object containing the module's actual implementation.
|
Object |
getInput(String name)
Gets the value of the input with the given name.
|
Map<String,Object> |
getInputs()
Gets a table of input values.
|
Object |
getOutput(String name)
Gets the value of the output with the given name.
|
Map<String,Object> |
getOutputs()
Gets a table of output values.
|
void |
initialize()
Initializes the module.
|
boolean |
isResolved(String name)
Gets the resolution status of the input with the given name.
|
void |
preview()
Computes a preview of the module's execution results, if available.
|
void |
setInput(String name,
Object value)
Sets the value of the input with the given name.
|
void |
setInputs(Map<String,Object> inputs)
Sets input values according to the given table.
|
void |
setOutput(String name,
Object value)
Sets the value of the output with the given name.
|
void |
setOutputs(Map<String,Object> outputs)
Sets output values according to the given table.
|
void |
setResolved(String name,
boolean resolved)
Sets the resolution status of the input with the given name.
|
public void preview()
ModuleRunnable.run(). Not all modules support
previews.preview in interface ModuleModuleInfo.canPreview()public void cancel()
ModuleModule.preview() to undo
any changes made as a result of the preview.cancel in interface ModuleModuleInfo.canCancel()public void initialize()
throws MethodCallException
Module
First, the module's global initializer method (if any) is called, followed
by each individual ModuleItem initializer method (i.e.,
ModuleItem.initialize(Module)).
initialize in interface ModuleMethodCallExceptionModuleInfo.getInitializer(),
ModuleItem.initialize(Module)public Object getDelegateObject()
ModulegetInfo().getDelegateClassName(). This object must possess all
callback methods specified by ModuleItem.getCallback().
The nature of this method is implementation-specific; e.g., a
CommandModule will return its associated Command. For
modules that are not plugins, the result may be something else. If you are
implementing this interface directly, a good rule of thumb is to return
this.
getDelegateObject in interface Modulepublic Object getInput(String name)
Modulepublic Object getOutput(String name)
Modulepublic Map<String,Object> getInputs()
Modulepublic Map<String,Object> getOutputs()
ModulegetOutputs in interface Modulepublic void setInput(String name, Object value)
Modulepublic void setOutput(String name, Object value)
Modulepublic void setInputs(Map<String,Object> inputs)
Modulepublic void setOutputs(Map<String,Object> outputs)
ModulesetOutputs in interface Modulepublic boolean isResolved(String name)
ModuleisResolved in interface Modulepublic void setResolved(String name, boolean resolved)
ModulesetResolved in interface ModuleCopyright © 2009–2016 SciJava. All rights reserved.