|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.ucsb.cs.jicos.services.Task
edu.ucsb.cs.jicos.services.external.services.TaskExternal
edu.ucsb.cs.jicos.services.external.services.matlab.TaskMatlab
public class TaskMatlab
| Field Summary | |
|---|---|
static int |
DATATYPE_Double
double (floating point) data type. |
static int |
DATATYPE_Float
floating point data type. |
static int |
DATATYPE_Int08
8-bit (signed) integer data type. |
static int |
DATATYPE_Int16
16-bit (signed) integer data type. |
static int |
DATATYPE_Int32
32-bit (signed) integer data type. |
static int |
DATATYPE_Int64
64-bit (signed) integer data type. |
static int |
DATATYPE_unknown
Unknown data type. |
| Fields inherited from class edu.ucsb.cs.jicos.services.external.services.TaskExternal |
|---|
serviceClass |
| Fields inherited from class edu.ucsb.cs.jicos.services.Task |
|---|
ALL_INPUTS |
| Fields inherited from interface edu.ucsb.cs.jicos.services.external.XmlConverter |
|---|
NAMESPACE, STYLESHEET_Html, STYLESHEET_Unknown, STYLESHEET_Xml |
| Constructor Summary | |
|---|---|
TaskMatlab()
Default, no argument, constructor. |
|
TaskMatlab(java.lang.String command)
Create a Matlab task with the specified command. |
|
TaskMatlab(java.lang.String command,
java.util.Map dataMap,
java.lang.String resultName)
Create a complete Matlab task. |
|
| Method Summary | |
|---|---|
void |
addData(java.util.Map dataMap)
Add the contents of a map to the contents of the data map. |
void |
addData(java.lang.String name,
java.lang.Object value)
Add an object to the data map of this task. |
java.lang.Object |
createInput(ExternalData externalData)
Create the input variable with data from the external data (should be overridden). |
XmlDocument |
createResult(java.lang.Object result)
Create an XML document from the result (should be overridden). |
Shared |
createShared(ExternalData externalData)
Create the shared object with data from the external data (should be overridden). |
java.lang.Object |
execute(Environment environment)
Get the Matlab engine and invoke a command on it. |
boolean |
fromXml(ExternalData externalData)
Populate the variables with data from the external data (should be overridden). |
java.lang.String |
getCommand()
Return the name of the command. |
java.lang.Object[][] |
getData()
Return the data in a n x2 array of data. |
java.lang.Object |
getData(java.lang.String name)
Get a particular data item by name. |
java.util.Map |
getDataMap()
Return the map of data (name/value pairs). |
static int |
getDataType(java.lang.String typeName)
Return the data type enumerator for the given name. |
java.lang.Object |
getMatlabResult()
Return the result of the matlab computation. |
java.lang.String |
getResultName()
Return the name of the variable containing the result. |
static java.lang.String |
getTypeName(int typeId)
Get the name of the typeId enumerator. |
void |
setCommand(java.lang.String command)
Set the command to be perfoirmed by matlab. |
void |
setData(java.util.Map dataMap)
Set the contents of the data map to the contents of the given map. |
void |
setMatlabResult(java.lang.Object matlabResult)
Save the result of the computation. |
void |
setResultName(java.lang.String resultName)
Set the name of the variable containing the result at the end of the computation. |
java.lang.String |
toHtmlString(XmlDocument xmlResult,
java.lang.String hostPort)
Create an HTML document from the result (should be overridden). |
protected java.lang.String |
toString_Matrix(java.lang.Number[][] matrix,
boolean isInteger)
Convert a matrix of java.lang.Number to a string. |
protected java.lang.String |
toString_MatrixFloat(java.lang.Object matrix)
Convert a vector of floating point numbers (float, or double) to a string. |
protected java.lang.String |
toString_MatrixInt(java.lang.Object matrix)
Convert a matrix of integers (short, int, or long) to a string. |
protected java.lang.String |
toString_Scalar(java.lang.Number scalar,
boolean isInteger)
Convert a java.lang.Number to a string using a number formatter. |
protected java.lang.String |
toString_Vector(java.lang.Number[] vector,
boolean isInteger)
Convert an array of java.lang.Numbers to a string. |
protected java.lang.String |
toString_VectorFloat(java.lang.Object vector)
Convert a vector of floating points (float, or double) to a string. |
protected java.lang.String |
toString_VectorInt(java.lang.Object vector)
Convert a vector of integers (short, int, or long) to a string. |
java.lang.String |
toString()
Override the default method to create a Java string (class[member,[...]]). |
java.lang.String |
toString(java.lang.Object object)
Convert an object to a string (depending on it's type). |
protected java.lang.String |
toXml_Matrix(java.lang.Object matrix,
java.lang.String name,
java.lang.String prefix)
Convert a matrix to an XML element. |
protected java.lang.String |
toXml_Scalar(java.lang.Number scalar,
java.lang.String name,
boolean isInteger,
java.lang.String prefix)
Convert a java.lang.Number to an XML element. |
protected java.lang.String |
toXml_String(java.lang.String string,
java.lang.String name,
java.lang.String prefix)
Convert a String to an XML element. |
protected java.lang.String |
toXml_Vector(java.lang.Object vector,
java.lang.String name,
java.lang.String prefix)
Convert a vector (1-dimensional array) to an XML element. |
java.lang.String |
toXml(java.lang.Object object,
java.lang.String name,
java.lang.String prefix)
Convert the given object to an XML string with the element
name given and precede each line of text with the given
prefix. |
java.lang.String |
toXml(java.lang.String prefix)
Create XML out of this object. |
| Methods inherited from class edu.ucsb.cs.jicos.services.external.services.TaskExternal |
|---|
getStyleSheet, serviceClass |
| Methods inherited from class edu.ucsb.cs.jicos.services.Task |
|---|
compute, execute, executeIncrementally, executeOnServer, getInput, getTaskId, isAtomic, numInputs, numUnsetInputs |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int DATATYPE_unknown
public static final int DATATYPE_Int08
public static final int DATATYPE_Int16
public static final int DATATYPE_Int32
public static final int DATATYPE_Int64
public static final int DATATYPE_Float
public static final int DATATYPE_Double
| Constructor Detail |
|---|
public TaskMatlab()
public TaskMatlab(java.lang.String command)
command - Matlab command.
public TaskMatlab(java.lang.String command,
java.util.Map dataMap,
java.lang.String resultName)
command - The matlab command to evaluate.dataMap - The supporting data for the command.resultName - The name of the variable containing the result.| Method Detail |
|---|
public java.lang.String getCommand()
public java.util.Map getDataMap()
public static int getDataType(java.lang.String typeName)
typeName - The name of the type.public java.lang.String getResultName()
public static java.lang.String getTypeName(int typeId)
typeId - The data type enumerator.public java.lang.Object[][] getData()
public java.lang.Object getData(java.lang.String name)
name - The name of the data item, null for the whole
thing.
null if not found.public java.lang.Object getMatlabResult()
public java.lang.String toString()
toString in class TaskTask:public java.lang.String toString(java.lang.Object object)
object - Some object.
public java.lang.String toXml(java.lang.Object object,
java.lang.String name,
java.lang.String prefix)
object to an XML string with the element
name given and precede each line of text with the given
prefix.
object - The object to convert.name - The name of the element.prefix - Precede each line of text with this string.public void setCommand(java.lang.String command)
command - Matlab command to invoke.public void setResultName(java.lang.String resultName)
resultName - The name of the variable.public void setData(java.util.Map dataMap)
dataMap - A map of variable name/value pairs.
public void addData(java.lang.String name,
java.lang.Object value)
name - The name of this variable.value - The value of this variable.public void addData(java.util.Map dataMap)
dataMap - Additional contents.public void setMatlabResult(java.lang.Object matlabResult)
matlabResult - The result of the matlab result.public java.lang.Object execute(Environment environment)
execute in class TaskExternalenvironment - The Jicos environment of this task.
Object is either the execute method's computed value
xor
a (compose) Task. In the latter case, the compose task takes the output from this
task's subtasks, and composes it to create this task's output.
This, at least, is the intent of this method's returned value.public java.lang.String toXml(java.lang.String prefix)
toXml in interface edu.ucsb.cs.jicos.services.external.XmlConvertertoXml in class TaskExternalprefix - Precede each line of output with this.public boolean fromXml(ExternalData externalData)
fromXml in interface edu.ucsb.cs.jicos.services.external.XmlConverterfromXml in class TaskExternalfalsepublic java.lang.Object createInput(ExternalData externalData)
createInput in interface edu.ucsb.cs.jicos.services.external.XmlConvertercreateInput in class TaskExternalnullpublic Shared createShared(ExternalData externalData)
createShared in interface edu.ucsb.cs.jicos.services.external.XmlConvertercreateShared in class TaskExternalfalse
public XmlDocument createResult(java.lang.Object result)
throws java.lang.Exception
createResult in interface edu.ucsb.cs.jicos.services.external.XmlConvertercreateResult in class TaskExternal>?xml version="1.0"?<
java.lang.Exception
public java.lang.String toHtmlString(XmlDocument xmlResult,
java.lang.String hostPort)
toHtmlString in interface edu.ucsb.cs.jicos.services.external.XmlConvertertoHtmlString in class TaskExternal
protected java.lang.String toString_Scalar(java.lang.Number scalar,
boolean isInteger)
scalar - The number to format.isInteger - Are the numbers integers?toString()
protected java.lang.String toString_Vector(java.lang.Number[] vector,
boolean isInteger)
vector - The array of numbers.isInteger - Are the numbers integers?toString()protected java.lang.String toString_VectorInt(java.lang.Object vector)
vector - The array of numbers.toString()protected java.lang.String toString_VectorFloat(java.lang.Object vector)
vector - The array of floating point numbers.toString()
protected java.lang.String toString_Matrix(java.lang.Number[][] matrix,
boolean isInteger)
matrix - The array of array of numbers.isInteger - Are the numbers integers?toString()protected java.lang.String toString_MatrixInt(java.lang.Object matrix)
matrix - The array of array of numbers.toString()protected java.lang.String toString_MatrixFloat(java.lang.Object matrix)
matrix - The array of array of numbers.toString()
protected java.lang.String toXml_String(java.lang.String string,
java.lang.String name,
java.lang.String prefix)
string - The string to convert.name - The name of the string element.prefix - Preced each line with this text.toXml(Object,String,String)
protected java.lang.String toXml_Scalar(java.lang.Number scalar,
java.lang.String name,
boolean isInteger,
java.lang.String prefix)
scalar - The number to convert.name - The name of the string element.isInteger - Is the number an integer or floating point?prefix - Preced each line with this text.toXml(Object,String,String)
protected java.lang.String toXml_Vector(java.lang.Object vector,
java.lang.String name,
java.lang.String prefix)
vector - The vector to convert.name - The name of the string element.prefix - Preced each line with this text.toXml(Object,String,String)
protected java.lang.String toXml_Matrix(java.lang.Object matrix,
java.lang.String name,
java.lang.String prefix)
matrix - The matrix to convert.name - The name of the string element.prefix - Preced each line with this text.toXml(Object,String,String)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||