Package mgui.interfaces.util
Interface Engine
- All Superinterfaces:
AttributeObject,NamedObject
- All Known Implementing Classes:
DrawingEngine,MeshEngine,MorphDrawEngine,NeuroMeshEngine,ShapeEngine,VolumeEngine
public interface Engine extends AttributeObject
Interface for all "engine" classes; i.e., instantiable classes which hold attributes and do work.
An engine is specified by a set of "operations". Each operation can be implemented by a set of "methods".
The combination of operation & method specifies what computation will be performed.
Each operation/method is fully specified by a corresponding AttributeList, which must be set prior to calling that method.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Method Summary
Modifier and Type Method Description booleancallMethod(java.lang.String operation, java.lang.String method, java.util.ArrayList<?> params, ProgressUpdater progress)Calls the specified operation/method pair.booleancallMethod(java.lang.String operation, java.lang.String method, ProgressUpdater progress)Calls the specified operation/method pair.AttributeListgetAttributes(java.lang.String operation, java.lang.String method)Returns the attributes list corresponding to theoperationandmethod.java.util.ArrayList<java.lang.String>getMethods(java.lang.String operation)Returns a list of methods implementing a particularoperation.java.util.ArrayList<java.lang.String>getOperations()Returns a list of the operations available for thisEngine.Methods inherited from interface mgui.interfaces.attributes.AttributeObject
getAttribute, getAttributes, getAttributeValue, setAttribute, setAttributesMethods inherited from interface mgui.interfaces.NamedObject
getName, setName
-
Method Details
-
getOperations
java.util.ArrayList<java.lang.String> getOperations()Returns a list of the operations available for thisEngine. Operations signify a general operation, which can be implemented through any number of "methods".- Returns:
-
getMethods
java.util.ArrayList<java.lang.String> getMethods(java.lang.String operation)Returns a list of methods implementing a particularoperation.- Parameters:
operation-- Returns:
-
callMethod
Calls the specified operation/method pair. Returnstrueif the operation was successful.- Parameters:
operation- Operation to perform.method- Method with which to perform operation. Can benullif this operation has no sub-methodsprogress- Optional progress updater (can benull)- Returns:
-
callMethod
boolean callMethod(java.lang.String operation, java.lang.String method, java.util.ArrayList<?> params, ProgressUpdater progress)Calls the specified operation/method pair. Returnstrueif the operation was successful.- Parameters:
operation- Operation to perform.method- Method with which to perform operation. Can benullif this operation has no sub-methodsparams- A list of additional parameters (not in the attributes) for this methodprogress- Optional progress updater (can benull)- Returns:
-
getAttributes
Returns the attributes list corresponding to theoperationandmethod.- Parameters:
key-- Returns:
- The corresponding attributes, or
nullif no such combination ofoperation/methodexists.
-