T
- the Data Typepublic abstract class Data<T extends Type> extends java.lang.Object implements DataState, java.lang.Cloneable
Modifier and Type | Class and Description |
---|---|
static class |
Data.Any
The Any Data value.
|
static class |
Data.Array
The array Data value.
|
static class |
Data.Bool
The boolean Data value.
|
static class |
Data.Byte
The byte Data value.
|
static class |
Data.Char
The char Data value.
|
static class |
Data.Double
The double Data value.
|
static class |
Data.Enum
The enumeration Data value.
|
static class |
Data.Float
The float Data value.
|
static class |
Data.Int
The int Data value.
|
static class |
Data.JSON
The JSON Data value.
|
static class |
Data.Long
The long Data value.
|
static class |
Data.MapData
The array Data value.
|
static class |
Data.Nil
The boolean Data value.
|
static class |
Data.Obj
The Object Data value.
|
static class |
Data.Short
The short Data value.
|
static class |
Data.Str
The String Data value.
|
static class |
Data.Structure
The Structure Data value.
|
static class |
Data.Switch
The switch Data value.
|
static class |
Data.Union
The Union Data value.
|
static class |
Data.Url
The URL Data value.
|
static class |
Data.Void
An empty void Data value.
|
static class |
Data.Xml
The XML Data value.
|
Modifier and Type | Field and Description |
---|---|
static Data.Void |
NULL_DATA
The null Data.
|
STATE_INVALID, STATE_MODIFIED, STATE_UNCHANGED
Constructor and Description |
---|
Data(ServiceDefinition.Data def)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Data<?> |
clone() |
short |
copy(Data<?> data)
Copy the value of another Data.
|
short |
copy(Data<?> data,
boolean strict)
Copy the value of another Data.
|
short |
copy(Data<?> data,
boolean clone,
boolean strict)
Copy the value of another Data.
|
java.lang.Object |
copyValue()
Copy the current value and return it.
|
short |
getDataChangeBehavior()
Return the change behavior for the data.
|
ServiceDefinition.Data |
getDefinition()
Return the Data definition.
|
java.lang.String |
getDescription()
Return the data description.
|
java.lang.String |
getName()
Return the data name.
|
java.lang.String |
getTopic()
Return the Data topic if the Data is associated with a Topic.
|
T |
getType()
Return the Data type.
|
abstract java.lang.Object |
getValue()
Return the data value.
|
java.lang.Object |
getValue(java.lang.Class<?> clazz)
Return the data value cast to a tagged instance.
|
java.util.List<java.lang.Object> |
getValueAsArray()
Return the data value as an array.
|
boolean |
getValueAsBoolean()
Return the data value as a boolean.
|
byte |
getValueAsByte()
Return the data value as a byte.
|
char |
getValueAsChar()
Return the data value as a char.
|
boolean |
getValueAsData(Data<?> data)
Return the value of a Data as another data.
|
double |
getValueAsDouble()
Return the data value as a double.
|
double |
getValueAsDouble(short unit)
Return the data value as a double, in a specified unit.
|
float |
getValueAsFloat()
Return the data value as a float.
|
float |
getValueAsFloat(short unit)
Return the data value as a float, in a specified unit.
|
int |
getValueAsInt()
Return the data value as an int.
|
org.json.JSONElement |
getValueAsJSON()
Return the data value as a JSONElement.
|
long |
getValueAsLong()
Return the data value as a long.
|
java.util.Map<java.lang.Object,java.lang.Object> |
getValueAsMap()
Return the data value as a Map.
|
short |
getValueAsShort()
Return the data value as a short.
|
java.lang.String |
getValueAsString()
Return the data value as a String.
|
java.util.List<java.lang.Object> |
getValueAsStructure()
Return the data value as a Structure.
|
java.util.List<java.lang.Object> |
getValueAsUnion()
Return the data value as an union.
|
java.net.URL |
getValueAsURL()
Return the data value as an URL.
|
org.mdiutil.xml.tree.XMLNode |
getValueAsXML()
Return the data value as an XML structure.
|
boolean |
hasChanged()
Return true if the data has been changed.
|
boolean |
isContinuous()
Return true if the data represents a continuous quantity.
|
boolean |
isEqualsTo(java.lang.Object o)
Return true if the current value of the data is equal to a current object value.
|
boolean |
isNumeric()
Return true if the data type is numeric.
|
short |
setBooleanValue(boolean value)
Set the data boolean value.
|
short |
setByteValue(byte value)
Set the data byte value.
|
short |
setChanged(boolean hasChanged)
Set if the data has been changed.
|
short |
setCharValue(char value)
Set the data char value.
|
short |
setDoubleValue(double value)
Set the data double value.
|
short |
setDoubleValue(double value,
short unit)
Set the data double value, in a specified unit.
|
short |
setFloatValue(double value,
short unit)
Set the data float value, in a specified unit.
|
short |
setFloatValue(float value)
Set the data float value.
|
short |
setIntValue(int value)
Set the data int value.
|
short |
setLongValue(long value)
Set the data long value.
|
short |
setShortValue(int value)
Set the data short value.
|
short |
setStringValue(java.lang.String value)
Set the data String value.
|
abstract short |
setValue(java.lang.Object value)
Set the data value.
|
short |
setValueFromInstance(java.lang.Object instance)
Return the data value as a tagged instance.
|
void |
touch()
Declare that the data has changed.
|
public static final Data.Void NULL_DATA
public Data(ServiceDefinition.Data def)
def
- the Data definitionpublic T getType()
public boolean isNumeric()
public boolean isContinuous()
public java.lang.String getTopic()
public short getDataChangeBehavior()
public java.lang.String getName()
public java.lang.String getDescription()
public ServiceDefinition.Data getDefinition()
public short copy(Data<?> data, boolean strict)
data
- the datastrict
- true if the framework should check if the types of the datas are compatibleDataState
public short copy(Data<?> data, boolean clone, boolean strict)
data
- the dataclone
- true if the content of the data must be clonedstrict
- true if the framework should check if the types of the datas are compatibleDataState
public short copy(Data<?> data)
data
- the dataDataState
public Data<?> clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public void touch()
setChanged(boolean)
with true
as argument.public short setChanged(boolean hasChanged)
hasChanged
- true if the data has been changedpublic boolean hasChanged()
public short setIntValue(int value)
value
- the valueDataState
public short setShortValue(int value)
value
- the valueDataState
public short setByteValue(byte value)
value
- the valueDataState
public short setCharValue(char value)
value
- the valueDataState
public short setLongValue(long value)
value
- the valueDataState
public short setFloatValue(float value)
value
- the valueDataState
public short setFloatValue(double value, short unit)
value
- the valueunit
- the unitDataState
public short setDoubleValue(double value)
value
- the valueDataState
public short setDoubleValue(double value, short unit)
value
- the valueunit
- the unitDataState
public short setBooleanValue(boolean value)
value
- the valueDataState
public short setStringValue(java.lang.String value)
value
- the valueDataState
public abstract short setValue(java.lang.Object value)
value
- the valueDataState
public abstract java.lang.Object getValue()
public java.lang.Object copyValue()
public java.lang.Object getValue(java.lang.Class<?> clazz)
clazz
- the instance classpublic short setValueFromInstance(java.lang.Object instance)
instance
- the instanceDataState
public boolean isEqualsTo(java.lang.Object o)
o
- the specified object valuepublic java.util.List<java.lang.Object> getValueAsUnion()
public java.util.List<java.lang.Object> getValueAsArray()
public boolean getValueAsData(Data<?> data)
data
- the other data. The content of this data will be filled with the value of this datapublic java.util.Map<java.lang.Object,java.lang.Object> getValueAsMap()
public java.util.List<java.lang.Object> getValueAsStructure()
public int getValueAsInt()
public long getValueAsLong()
public double getValueAsDouble(short unit)
unit
- the unitpublic double getValueAsDouble()
public float getValueAsFloat(short unit)
unit
- the unitpublic float getValueAsFloat()
public short getValueAsShort()
public byte getValueAsByte()
public char getValueAsChar()
public boolean getValueAsBoolean()
public java.lang.String getValueAsString()
public org.mdiutil.xml.tree.XMLNode getValueAsXML()
public org.json.JSONElement getValueAsJSON()
public java.net.URL getValueAsURL()
Copyright ©2017-2023 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence