public class Datas
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Method and Description |
---|---|
Datas |
clone() |
void |
copyFrom(java.util.Map<java.lang.String,Data<?>> origin)
Copy the Datas from another Datas.
|
Data<?> |
getData(java.lang.String name)
Return the Service Datas.
|
Data.Array |
getDataAsArray(java.lang.String name)
Return the Data of a specified name, as an array. it will return null if the Data is not an array.
|
Data.MapData |
getDataAsMap(java.lang.String name)
Return the Data of a specified name, as a Map. it will return null if the Data is not a Map.
|
Data.Structure |
getDataAsStructure(java.lang.String name)
Return the Data of a specified name, as a structure. it will return null if the Data is not a structure.
|
Data.Switch |
getDataAsSwitch(java.lang.String name)
Return the Data of a specified name, as a Switch. it will return null if the Data is not a switch.
|
Data.Union |
getDataAsUnion(java.lang.String name)
Return the Data of a specified name, as an Union. it will return null if the Data is not an Union.
|
java.util.Map<java.lang.String,Data<?>> |
getDatas()
Return the map of datas.
|
static Datas |
getEmptyDatas()
Return an empty Data list, which contains no Data.
|
Service<?> |
getService()
Return the Service.
|
boolean |
hasChanged(java.lang.String name)
Return true if the Data with a specified name has changed since the last reception.
|
boolean |
hasData(java.lang.String name)
Return true if the Service has a Data of a specified name.
|
short |
setDataBooleanValue(java.lang.String name,
boolean value)
Set the boolean value of a Data.
|
short |
setDataByteValue(java.lang.String name,
byte value)
Set the byte value of a Data.
|
short |
setDataCharValue(java.lang.String name,
char value)
Set the char value of a Data.
|
short |
setDataDoubleValue(java.lang.String name,
double value)
Set the double value of a Data.
|
short |
setDataDoubleValue(java.lang.String name,
double value,
short unit)
Set the double value of a Data.
|
short |
setDataFileValue(java.lang.String name,
java.io.File value)
Set a File Data value.
|
short |
setDataFloatValue(java.lang.String name,
float value)
Set the float value of a Data.
|
short |
setDataFloatValue(java.lang.String name,
float value,
short unit)
Set the float value of a Data.
|
short |
setDataIntValue(java.lang.String name,
int value)
Set the int value of a Data.
|
short |
setDataJSONValue(java.lang.String name,
org.json.JSONElement value)
Set the JSON value of a Data as a JSONElement.
|
short |
setDataLongValue(java.lang.String name,
long value)
Set the long value of a Data.
|
short |
setDataShortValue(java.lang.String name,
short value)
Set the short value of a Data.
|
short |
setDataStringValue(java.lang.String name,
java.lang.String value)
Set the String value of a Data.
|
short |
setDataURLValue(java.lang.String name,
java.net.URL value)
Set the value of a Data as an URL.
|
short |
setDataValue(java.lang.String name,
java.lang.Object value)
Set the value of a Data.
|
short |
setDataXMLValue(java.lang.String name,
org.mdiutil.xml.tree.XMLNode value)
Set the XML value of a Data as an XMLNode.
|
void |
setup()
Setup the Datas.
|
public Datas(Service<?> service)
service
- the Servicepublic static Datas getEmptyDatas()
public Service<?> getService()
public java.util.Map<java.lang.String,Data<?>> getDatas()
public void copyFrom(java.util.Map<java.lang.String,Data<?>> origin)
origin
- the origin Dataspublic Datas clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public void setup()
public short setDataValue(java.lang.String name, java.lang.Object value)
name
- the Data namevalue
- the Data valuepublic short setDataIntValue(java.lang.String name, int value)
name
- the Data namevalue
- the Data int valuepublic short setDataByteValue(java.lang.String name, byte value)
name
- the Data namevalue
- the Data byte valuepublic short setDataLongValue(java.lang.String name, long value)
name
- the Data namevalue
- the Data long valuepublic short setDataCharValue(java.lang.String name, char value)
name
- the Data namevalue
- the Data char valuepublic short setDataShortValue(java.lang.String name, short value)
name
- the Data namevalue
- the Data short valuepublic short setDataFloatValue(java.lang.String name, float value)
name
- the Data namevalue
- the Data float valuepublic short setDataFloatValue(java.lang.String name, float value, short unit)
name
- the Data namevalue
- the Data float valueunit
- the unitpublic short setDataDoubleValue(java.lang.String name, double value)
name
- the Data namevalue
- the Data double valuepublic short setDataDoubleValue(java.lang.String name, double value, short unit)
name
- the Data namevalue
- the Data double valueunit
- the unitpublic short setDataBooleanValue(java.lang.String name, boolean value)
name
- the Data namevalue
- the Data boolean valuepublic short setDataStringValue(java.lang.String name, java.lang.String value)
name
- the Data namevalue
- the Data String valuepublic short setDataXMLValue(java.lang.String name, org.mdiutil.xml.tree.XMLNode value)
name
- the Data namevalue
- the Data XMLNode valuepublic short setDataJSONValue(java.lang.String name, org.json.JSONElement value)
name
- the Data namevalue
- the Data XMLNode valuepublic short setDataFileValue(java.lang.String name, java.io.File value)
name
- the data namevalue
- the data File value, as a StringDataState
)public short setDataURLValue(java.lang.String name, java.net.URL value)
name
- the Data namevalue
- the Data URL valuepublic Data<?> getData(java.lang.String name)
name
- the data namepublic Data.Structure getDataAsStructure(java.lang.String name)
name
- the namepublic Data.Array getDataAsArray(java.lang.String name)
name
- the namepublic Data.MapData getDataAsMap(java.lang.String name)
name
- the namepublic Data.Union getDataAsUnion(java.lang.String name)
name
- the namepublic Data.Switch getDataAsSwitch(java.lang.String name)
name
- the namepublic boolean hasData(java.lang.String name)
name
- the data namepublic boolean hasChanged(java.lang.String name)
name
- the data nameCopyright ©2017-2023 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence