|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ptolemy.fmi.FMIScalarVariable
public class FMIScalarVariable
An object that represents the ScalarVariable element of a modelDescription.xml file contained within a Functional Mock-up Interface .fmu XML file.
A Functional Mock-up Unit file is a .fmu file in zip format that contains a .xml file named "modelDescription.xml". In that file, the ModelVariables element may contain elements such as ScalarVariable.
FMI documentation may be found at http://www.modelisar.com/fmi.html.
Red (cxh) |
Red (cxh) |
Nested Class Summary | |
---|---|
static class |
FMIScalarVariable.Alias
Acceptable values for the alias xml attribute. |
static class |
FMIScalarVariable.Causality
Acceptable values for the causality xml attribute. |
static class |
FMIScalarVariable.Variability
Acceptable values for the variability xml attribute. |
Field Summary | |
---|---|
private static java.util.Set<java.lang.String> |
_errorElements
The set of elements that we don't yet handle. |
private com.sun.jna.Function |
_fmiGetFunction
The FMI .c function that gets the value of this variable. |
private com.sun.jna.Function |
_fmiSetFunction
The FMI .c function that sets the value of this variable. |
private java.lang.String |
_typeName
The name of the type of this variable. |
FMIScalarVariable.Alias |
alias
The value of the alias xml attribute. |
FMIScalarVariable.Causality |
causality
The value of the causality xml attribute. |
java.lang.String |
description
The value of the description xml attribute. |
java.util.Set<java.lang.String> |
directDependency
The input ports on which an output has a direct dependence. |
FMIModelDescription |
fmiModelDescription
The Model Description for this variable. |
java.lang.String |
name
The value of the name xml attribute. |
FMIType |
type
The value of the type xml attribute. |
long |
valueReference
The value of the valueReference xml attribute. |
FMIScalarVariable.Variability |
variability
The value of the variability xml attribute. |
Constructor Summary | |
---|---|
FMIScalarVariable()
Create an empty ScalarVariable. |
|
FMIScalarVariable(FMIModelDescription fmiModelDescription,
org.w3c.dom.Element element)
Create a ScalarVariable from an XML Element. |
Method Summary | |
---|---|
private void |
_getOrSetValue(com.sun.jna.Pointer fmiComponent,
java.lang.Object valueBuffer,
java.lang.Class typeClass,
com.sun.jna.Function getOrSetFunction)
Get or set the value of this variable. |
private void |
_getValue(com.sun.jna.Pointer fmiComponent,
java.lang.Object valueBuffer,
java.lang.Class typeClass)
Get the value of this variable. |
private void |
_setValue(com.sun.jna.Pointer fmiComponent,
java.lang.Object valueBuffer,
java.lang.Class typeClass)
Set the value of this variable. |
boolean |
getBoolean(com.sun.jna.Pointer fmiComponent)
Return the value of this variable as a boolean. |
double |
getDouble(com.sun.jna.Pointer fmiComponent)
Return the value of this variable as a double. |
int |
getInt(com.sun.jna.Pointer fmiComponent)
Return the value of this variable as an int. |
java.lang.String |
getString(com.sun.jna.Pointer fmiComponent)
Return the value of this variable as a String. |
void |
setBoolean(com.sun.jna.Pointer fmiComponent,
boolean value)
Set the value of this variable as a boolean. |
void |
setDouble(com.sun.jna.Pointer fmiComponent,
double value)
Set the value of this variable as a double. |
void |
setInt(com.sun.jna.Pointer fmiComponent,
int value)
Set the value of this variable as an integer. |
void |
setString(com.sun.jna.Pointer fmiComponent,
java.lang.String value)
Set the value of this variable as a String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public FMIScalarVariable.Alias alias
public FMIScalarVariable.Causality causality
public java.lang.String description
public java.util.Set<java.lang.String> directDependency
public FMIModelDescription fmiModelDescription
public java.lang.String name
public FMIType type
public long valueReference
public FMIScalarVariable.Variability variability
private static java.util.Set<java.lang.String> _errorElements
private com.sun.jna.Function _fmiGetFunction
private com.sun.jna.Function _fmiSetFunction
private java.lang.String _typeName
Constructor Detail |
---|
public FMIScalarVariable()
public FMIScalarVariable(FMIModelDescription fmiModelDescription, org.w3c.dom.Element element)
fmiModelDescription
- the Model Description for this variable.element
- The XML Element that contains attributes.Method Detail |
---|
public boolean getBoolean(com.sun.jna.Pointer fmiComponent)
fmiComponent
- The Functional Mock-up Interface (FMI)
component that contains a reference to the variable.
setBoolean(Pointer, boolean)
public double getDouble(com.sun.jna.Pointer fmiComponent)
fmiComponent
- The Functional Mock-up Interface (FMI)
component that contains a reference to the variable.
setDouble(Pointer, double)
public int getInt(com.sun.jna.Pointer fmiComponent)
fmiComponent
- The Functional Mock-up Interface (FMI)
component that contains a reference to the variable.
setInt(Pointer, int)
public java.lang.String getString(com.sun.jna.Pointer fmiComponent)
fmiComponent
- The Functional Mock-up Interface (FMI)
component that contains a reference to the variable.
setString(Pointer, String)
public void setBoolean(com.sun.jna.Pointer fmiComponent, boolean value)
fmiComponent
- The Functional Mock-up Interface (FMI)
component that contains a reference to the variable.value
- The value of this variable.getBoolean(Pointer fmiComponent)
public void setDouble(com.sun.jna.Pointer fmiComponent, double value)
fmiComponent
- The Functional Mock-up Interface (FMI)
component that contains a reference to the variable.value
- The value of this variable.getDouble(Pointer)
public void setInt(com.sun.jna.Pointer fmiComponent, int value)
fmiComponent
- The Functional Mock-up Interface (FMI)
component that contains a reference to the variable.value
- The value of this variable.getInt(Pointer)
public void setString(com.sun.jna.Pointer fmiComponent, java.lang.String value)
fmiComponent
- The Functional Mock-up Interface (FMI)
component that contains a reference to the variable.value
- The value of this variable.getString(Pointer)
private void _getOrSetValue(com.sun.jna.Pointer fmiComponent, java.lang.Object valueBuffer, java.lang.Class typeClass, com.sun.jna.Function getOrSetFunction)
fmiComponent
- The Functional Mock-up Interface (FMI)
component that contains a reference to the variable.valueBuffer
- The buffer that contains the value to be gotten or set.
For booleans, doubles and integers, this is a Buffer, for
String it is a PointerByReferencetypeClass
- The expected class of the type.getOrSetFunction
- the fmiGet or fmiSet function.private void _getValue(com.sun.jna.Pointer fmiComponent, java.lang.Object valueBuffer, java.lang.Class typeClass)
fmiComponent
- The Functional Mock-up Interface (FMI)
component that contains a reference to the variable.valueBuffer
- The buffer that contains the value to be gotten.
For booleans, doubles and integers, this is a Buffer, for
String it is a PointerByReferencetypeClass
- The expected class of the type.private void _setValue(com.sun.jna.Pointer fmiComponent, java.lang.Object valueBuffer, java.lang.Class typeClass)
fmiComponent
- The Functional Mock-up Interface (FMI)
component that contains a reference to the variable.valueBuffer
- The buffer that contains the value to be set.
For booleans, doubles and integers, this is a Buffer, for
String it is a PointerByReferencetypeClass
- The expected class of the type.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |