|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectes.unex.sextante.core.GeoAlgorithm
es.unex.sextante.modeler.ModelAlgorithm
public class ModelAlgorithm
An algorithm representing a model (a set of other geoalgorithms linked together in a workflow)
Constructor Summary | |
---|---|
ModelAlgorithm()
Creates a new model algorithm |
Method Summary | |
---|---|
void |
addAlgorithm(GeoAlgorithm alg,
java.lang.String sName)
Adds a new algorithm to the model |
void |
addInput(Parameter param)
Adds an input to the model |
boolean |
addInputAsignment(java.lang.String sParamName,
java.lang.String sInputName,
GeoAlgorithm alg)
Adds an input assignment |
void |
defineCharacteristics()
This method should be overridden and used to specify the parameters needed by the GeoAlgorithm, using the corresponding methods of the ParametersSet object. |
GeoAlgorithm |
getAlgorithm(java.lang.String sKey)
Returns an algorithm from the ones used in this model |
java.lang.String[] |
getAlgorithmAsCommandLineSentences()
Returns the command line expression that would create this instance of the algorithm |
java.util.ArrayList |
getAlgorithmKeys()
Returns an arraylist with algorithm keys |
java.util.ArrayList |
getAlgorithms()
Returns an arraylist with algorithms used in this model |
java.lang.String |
getCommandLineHelp()
Returns a string containing the command line usage of the algorithm |
java.lang.String |
getFilename()
Returns the filename associated with this model |
java.lang.String |
getInputAsignment(java.lang.String sParamName,
GeoAlgorithm alg)
|
java.util.ArrayList |
getInputAssignments()
|
java.util.HashMap |
getInputAssignments(java.lang.String sKey)
|
java.util.HashMap |
getInputs()
|
GeoAlgorithm |
getNewInstance()
|
boolean |
processAlgorithm()
This method should implement the algorithm itself, using the values of the parameters and processing them. |
void |
removeAlgorithm(java.lang.String sKey)
Removes an algorithm from the model |
void |
removeInput(Parameter param)
Removes a parameter input |
void |
removeInput(java.lang.String sKey)
Removes a parameter input |
void |
setFilename(java.lang.String sFilename)
Sets the filename associated with this model |
void |
setValues(java.util.ArrayList algs,
java.util.ArrayList algKeys,
java.util.ArrayList assignments,
java.util.HashMap inputs,
OutputObjectsSet outputs)
Sets the values used by the model algorithm |
void |
unassign(java.lang.String sAssignmentKey)
Removes an assignment |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ModelAlgorithm()
Method Detail |
---|
public void defineCharacteristics()
GeoAlgorithm
GeoAlgorithm.addOutputRasterLayer(java.lang.String, java.lang.String, int, es.unex.sextante.outputs.IOutputChannel, es.unex.sextante.dataObjects.IRasterLayer)
, GeoAlgorithm.addOutputVectorLayer(java.lang.String, java.lang.String, int, es.unex.sextante.outputs.IOutputChannel, es.unex.sextante.dataObjects.IVectorLayer)
, etc.)
defineCharacteristics
in class GeoAlgorithm
public void setValues(java.util.ArrayList algs, java.util.ArrayList algKeys, java.util.ArrayList assignments, java.util.HashMap inputs, OutputObjectsSet outputs)
algs
- The list of algorithm used by the modelalgKeys
- a list of keys to identify the used algorithmsassignments
- a list of assignmentsinputs
- the list of inputs of the algorithmoutputs
- The output objects that the algorithm generatespublic boolean processAlgorithm() throws GeoAlgorithmExecutionException
GeoAlgorithm
processAlgorithm
in class GeoAlgorithm
GeoAlgorithmExecutionException
- if there were problems
during algorithm executionpublic void addAlgorithm(GeoAlgorithm alg, java.lang.String sName)
alg
- the algorithm to addsName
- the name to identify the algorithmpublic void removeAlgorithm(java.lang.String sKey)
sKey
- the name to identify the algorithm to removepublic boolean addInputAsignment(java.lang.String sParamName, java.lang.String sInputName, GeoAlgorithm alg)
sParamName
- the name of the parametersInputName
- the name of the inputalg
- the algorithm
public void addInput(Parameter param) throws RepeatedParameterNameException
param
- the input parameter to add
RepeatedParameterNameException
public void removeInput(Parameter param)
param
- the parameter to removepublic void removeInput(java.lang.String sKey)
sKey
- the name of the parameter to removepublic void unassign(java.lang.String sAssignmentKey)
sAssignmentKey
- the key of the assignment to removepublic java.util.ArrayList getAlgorithmKeys()
public java.util.ArrayList getAlgorithms()
public java.util.ArrayList getInputAssignments()
public java.util.HashMap getInputs()
public GeoAlgorithm getAlgorithm(java.lang.String sKey)
sKey
- the key used to identify the algorithm to get
public java.util.HashMap getInputAssignments(java.lang.String sKey)
public java.lang.String getInputAsignment(java.lang.String sParamName, GeoAlgorithm alg)
public GeoAlgorithm getNewInstance() throws java.lang.InstantiationException, java.lang.IllegalAccessException
getNewInstance
in class GeoAlgorithm
java.lang.InstantiationException
java.lang.IllegalAccessException
public java.lang.String getFilename()
public void setFilename(java.lang.String sFilename)
sFilename
- the filename where this model is
storedpublic java.lang.String getCommandLineHelp()
GeoAlgorithm
getCommandLineHelp
in class GeoAlgorithm
public java.lang.String[] getAlgorithmAsCommandLineSentences()
GeoAlgorithm
getAlgorithmAsCommandLineSentences
in class GeoAlgorithm
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |