public interface DipData extends Serializable
created
by the DIP
factory.
DipData objects are also delivered to
subscription listeners
as result of subscription.
DipData objects can contain one or more named entries, each holding a scalar, a string or a single-dimensional array of these. The table below shows the supported data types and the correspondence to Java and C++ types when DipData objects are passed between C++ and Java applications.
type name | C++ type | Java type |
Boolean | bool | boolean |
Byte | signed char | byte |
Short | short | short |
Int | long | int |
Long | long long | long |
Float | float | float |
Double | double | double |
String | null-terminated string | String |
tag
.tag
.Modifier and Type | Field and Description |
---|---|
static int |
TYPE_BOOLEAN
Indicates a
boolean value. |
static int |
TYPE_BOOLEAN_ARRAY
Indicates a
boolean array value. |
static int |
TYPE_BYTE
Indicates a
byte value. |
static int |
TYPE_BYTE_ARRAY
Indicates a
byte array value. |
static int |
TYPE_DOUBLE
Indicates a
double value. |
static int |
TYPE_DOUBLE_ARRAY
Indicates a
double array value. |
static int |
TYPE_FLOAT
Indicates a
float value. |
static int |
TYPE_FLOAT_ARRAY
Indicates a
float array value. |
static int |
TYPE_INT
Indicates an
int value. |
static int |
TYPE_INT_ARRAY
Indicates an
int array value. |
static int |
TYPE_LONG
Indicates a
long value. |
static int |
TYPE_LONG_ARRAY
Indicates a
long array value. |
static int |
TYPE_NULL
Indicates an empty entry.
|
static int |
TYPE_SHORT
Indicates a
short value. |
static int |
TYPE_SHORT_ARRAY
Indicates a
short array value. |
static int |
TYPE_STRING
Indicates a
String value. |
static int |
TYPE_STRING_ARRAY
Indicates a
String array value. |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(String tag)
Returns
true if this object contains an entry with the
specified tag. |
boolean |
extractBoolean()
Returns the
boolean stored in the default data entry. |
boolean |
extractBoolean(String tag)
Returns the
boolean stored in the specified data entry. |
boolean[] |
extractBooleanArray()
Returns the
boolean array stored in the default data entry. |
boolean[] |
extractBooleanArray(String tag)
Returns the
boolean array stored in the specified data entry. |
byte |
extractByte()
Returns the
byte stored in the default data entry. |
byte |
extractByte(String tag)
Returns the
byte stored in the specified data entry. |
byte[] |
extractByteArray()
Returns the
byte array stored in the default data entry. |
byte[] |
extractByteArray(String tag)
Returns the
byte array stored in the specified data entry. |
int |
extractDataQuality()
Returns the data quality value of this DipData object as an int.
|
DipQualityEnum |
extractDataQualityEnum() |
DipTimestamp |
extractDipTime()
Returns the
DipTimestamp of this DipData object. |
double |
extractDouble()
Returns the
float array stored in the default data entry. |
double |
extractDouble(String tag)
Returns the
float array stored in the default data entry. |
double[] |
extractDoubleArray()
Returns the
double array stored in the default data entry. |
double[] |
extractDoubleArray(String tag)
Returns the
double array stored in the specified data entry. |
float |
extractFloat()
Extracts the default value from the DipData object as a float.
|
float |
extractFloat(String tag)
Returns the
float stored in the specified data entry. |
float[] |
extractFloatArray()
Returns the
double stored in the default data entry. |
float[] |
extractFloatArray(String tag)
Returns the
float array stored in the specified data entry. |
int |
extractInt()
Returns the
int stored in the default data entry. |
int |
extractInt(String tag)
Returns the
int stored in the specified data entry. |
int[] |
extractIntArray()
Returns the
int array stored in the default data entry. |
int[] |
extractIntArray(String tag)
Returns the
int array stored in the specified data entry. |
long |
extractLong()
Returns the
long stored in the default data entry. |
long |
extractLong(String tag)
Returns the
long stored in the specified data entry. |
long[] |
extractLongArray()
Returns the
long array stored in the default data entry. |
long[] |
extractLongArray(String tag)
Returns the
long array stored in the specified data entry. |
String |
extractQualityString()
Extracts the string that describes the reason for the quality.
|
short |
extractShort()
Returns the
short stored in the default data entry. |
short |
extractShort(String tag)
Returns the
short stored in the specified data entry. |
short[] |
extractShortArray()
Returns the
short array stored in the default data entry. |
short[] |
extractShortArray(String tag)
Returns the
short array stored in the specified data entry. |
String |
extractString()
Returns the
String stored in the default data entry. |
String |
extractString(String tag)
Returns the
String stored in the specified data entry. |
String[] |
extractStringArray()
Returns the
String array stored in the default data entry. |
String[] |
extractStringArray(String tag)
Returns the
String array stored in the specified data entry. |
String[] |
getTags()
Returns an unordered String array that contains tags of all
entries.
|
Map<String,Object> |
getValueAsMap()
Returns the contents of the DipData as a field name / value map.
|
int |
getValueType()
Returns type code for the value contained in the default entry.
|
int |
getValueType(String tag)
Returns type code for the value contained in the specified entry.
|
void |
insert(boolean value)
Inserts a boolean as default value into the DipData object.
|
void |
insert(boolean[] value)
Inserts a boolean array as default value into the DipData object.
|
void |
insert(byte value)
Inserts a byte as default value into the DipData object.
|
void |
insert(byte[] value)
Inserts a byte array as default value into the DipData object.
|
void |
insert(double value)
Inserts a double as default value into the DipData object.
|
void |
insert(double[] value)
Inserts a double array as default value into the DipData object.
|
void |
insert(float value)
Inserts a float as default value into the DipData object.
|
void |
insert(float[] value)
Inserts a float array as default value into the DipData object.
|
void |
insert(int value)
Inserts an int as default value into the DipData object.
|
void |
insert(int[] value)
Inserts an int array as default value into the DipData object.
|
void |
insert(long value)
Inserts a long as default value into the DipData object.
|
void |
insert(long[] value)
Inserts a long array as default value into the DipData object.
|
void |
insert(short value)
Inserts a short as default value into the DipData object.
|
void |
insert(short[] value)
Inserts an short array as default value into the DipData object.
|
void |
insert(String value)
Inserts a String as default value into the DipData object.
|
void |
insert(String[] value)
Inserts a String array as default value into the DipData object.
|
void |
insert(String tag,
boolean value)
Inserts a named boolean entry into the DipData object.
|
void |
insert(String tag,
boolean[] value)
Inserts a named boolean array entry into the DipData object.
|
void |
insert(String tag,
byte value)
Inserts a named byte entry into the DipData object.
|
void |
insert(String tag,
byte[] value)
Inserts a named byte array entry into the DipData object.
|
void |
insert(String tag,
double value)
Inserts a named double entry into the DipData object.
|
void |
insert(String tag,
double[] value)
Inserts a named double array entry into the DipData object.
|
void |
insert(String tag,
float value)
Inserts a named float entry into the DipData object.
|
void |
insert(String tag,
float[] value)
Inserts a named float array entry into the DipData object.
|
void |
insert(String tag,
int value)
Inserts a named int entry into the DipData object.
|
void |
insert(String tag,
int[] value)
Inserts a named int array entry into the DipData object.
|
void |
insert(String tag,
long value)
Inserts a named long entry into the DipData object.
|
void |
insert(String tag,
long[] value)
Inserts a named long array entry into the DipData object.
|
void |
insert(String tag,
short value)
Inserts a named short entry into the DipData object.
|
void |
insert(String tag,
short[] value)
Inserts a named short array entry into the DipData object.
|
void |
insert(String tag,
String value)
Inserts a named String entry into the DipData object.
|
void |
insert(String tag,
String[] value)
Inserts a named String array entry into the DipData object.
|
boolean |
isEmpty()
Returns
true if this DipData contains no entries;
false otherwise. |
int |
size()
Returns the number of entries in this object.
|
static final int TYPE_NULL
static final int TYPE_BOOLEAN
boolean
value.static final int TYPE_BOOLEAN_ARRAY
boolean
array value.static final int TYPE_BYTE
byte
value.static final int TYPE_BYTE_ARRAY
byte
array value.static final int TYPE_SHORT
short
value.static final int TYPE_SHORT_ARRAY
short
array value.static final int TYPE_INT
int
value.static final int TYPE_INT_ARRAY
int
array value.static final int TYPE_LONG
long
value.static final int TYPE_LONG_ARRAY
long
array value.static final int TYPE_FLOAT
float
value.static final int TYPE_FLOAT_ARRAY
float
array value.static final int TYPE_DOUBLE
double
value.static final int TYPE_DOUBLE_ARRAY
double
array value.static final int TYPE_STRING
String
value.static final int TYPE_STRING_ARRAY
String
array value.boolean isEmpty()
true
if this DipData contains no entries;
false
otherwise.int size()
String[] getTags()
boolean contains(String tag)
true
if this object contains an entry with the
specified tag.void insert(float value) throws TypeMismatch
value
- - the value to be writtenTypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.void insert(String tag, float value) throws TypeMismatch
tag
- - name of the 'field' the value belongs to.value
- - the value to be writtenTypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.void insert(double value) throws TypeMismatch
value
- - the value to be writtenTypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.void insert(String tag, double value) throws TypeMismatch
tag
- - name of the 'field' the value belongs to.value
- - the value to be writtenTypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.void insert(float[] value) throws TypeMismatch
value
- - the value to be writtenTypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.void insert(String tag, float[] value) throws TypeMismatch
tag
- - name of the 'field' the value belongs to.value
- - the value to be writtenTypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.void insert(double[] value) throws TypeMismatch
value
- - the value to be writtenTypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.void insert(String tag, double[] value) throws TypeMismatch
tag
- - name of the 'field' the value belongs to.value
- - the value to be writtenTypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.void insert(short value) throws TypeMismatch
value
- - the value to be writtenTypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.void insert(String tag, short value) throws TypeMismatch
tag
- - name of the 'field' the value belongs to.value
- - the value to be writtenTypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.void insert(short[] value) throws TypeMismatch
value
- - the value to be writtenTypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.void insert(String tag, short[] value) throws TypeMismatch
tag
- - name of the 'field' the value belongs to.value
- - the value to be writtenTypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.void insert(int value) throws TypeMismatch
value
- - the value to be writtenTypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.void insert(String tag, int value) throws TypeMismatch
tag
- - name of the 'field' the value belongs to.value
- - the value to be writtenTypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.void insert(int[] value) throws TypeMismatch
value
- - the value to be writtenTypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.void insert(String tag, int[] value) throws TypeMismatch
tag
- - name of the 'field' the value belongs to.value
- - the value to be writtenTypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.void insert(long value) throws TypeMismatch
value
- - the value to be writtenTypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.void insert(String tag, long value) throws TypeMismatch
tag
- - name of the 'field' the value belongs to.value
- - the value to be writtenTypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.void insert(long[] value) throws TypeMismatch
value
- - the value to be writtenTypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.void insert(String tag, long[] value) throws TypeMismatch
tag
- - name of the 'field' the value belongs to.value
- - the value to be writtenTypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.void insert(byte value) throws TypeMismatch
value
- - the value to be writtenTypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.void insert(String tag, byte value) throws TypeMismatch
tag
- - name of the 'field' the value belongs to.value
- - the value to be writtenTypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.void insert(byte[] value) throws TypeMismatch
value
- - the value to be writtenTypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.void insert(String tag, byte[] value) throws TypeMismatch
tag
- - name of the 'field' the value belongs to.value
- - the value to be writtenTypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.void insert(boolean value) throws TypeMismatch
value
- - the value to be writtenTypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.void insert(String tag, boolean value) throws TypeMismatch
tag
- - name of the 'field' the value belongs to.value
- - the value to be writtenTypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.void insert(boolean[] value) throws TypeMismatch
value
- - the value to be writtenTypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.void insert(String tag, boolean[] value) throws TypeMismatch
tag
- - name of the 'field' the value belongs to.value
- - the value to be writtenTypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.void insert(String value) throws TypeMismatch
value
- - the value to be writtenTypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.void insert(String tag, String value) throws TypeMismatch
tag
- - name of the 'field' the value belongs to.value
- - the value to be writtenTypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.void insert(String[] value) throws TypeMismatch
value
- - the value to be writtenTypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.void insert(String tag, String[] value) throws TypeMismatch
tag
- - name of the 'field' the value belongs to.value
- - the value to be writtenTypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.float extractFloat() throws TypeMismatch
TypeMismatch
float extractFloat(String tag) throws BadParameter, TypeMismatch
float
stored in the specified data entry.BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than a float
,
or nothing.float[] extractFloatArray(String tag) throws BadParameter, TypeMismatch
float
array stored in the specified data entry.BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than a float
array,
or nothing.float[] extractFloatArray() throws TypeMismatch
double
stored in the default data entry.TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.double extractDouble() throws TypeMismatch
float
array stored in the default data entry.TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.double extractDouble(String tag) throws BadParameter, TypeMismatch
float
array stored in the default data entry.BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than a double
array,
or nothing.double[] extractDoubleArray() throws TypeMismatch
double
array stored in the default data entry.TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.double[] extractDoubleArray(String tag) throws BadParameter, TypeMismatch
double
array stored in the specified data entry.BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than a double
array,
or nothing.short extractShort() throws TypeMismatch
short
stored in the default data entry.TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.short extractShort(String tag) throws BadParameter, TypeMismatch
short
stored in the specified data entry.BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than a short
,
or nothing.short[] extractShortArray() throws TypeMismatch
short
array stored in the default data entry.TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.short[] extractShortArray(String tag) throws BadParameter, TypeMismatch
short
array stored in the specified data entry.BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than a short
array,
or nothing.int extractInt() throws TypeMismatch
int
stored in the default data entry.TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.int extractInt(String tag) throws BadParameter, TypeMismatch
int
stored in the specified data entry.BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than a int
,
or nothing.int[] extractIntArray() throws TypeMismatch
int
array stored in the default data entry.TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.int[] extractIntArray(String tag) throws BadParameter, TypeMismatch
int
array stored in the specified data entry.BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than a int
array,
or nothing.long extractLong() throws TypeMismatch
long
stored in the default data entry.TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.long extractLong(String tag) throws BadParameter, TypeMismatch
long
stored in the specified data entry.BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than a long
,
or nothing.long[] extractLongArray() throws TypeMismatch
long
array stored in the default data entry.TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.long[] extractLongArray(String tag) throws BadParameter, TypeMismatch
long
array stored in the specified data entry.BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than a long
array,
or nothing.byte extractByte() throws TypeMismatch
byte
stored in the default data entry.TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.byte extractByte(String tag) throws BadParameter, TypeMismatch
byte
stored in the specified data entry.BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than a byte
,
or nothing.byte[] extractByteArray() throws TypeMismatch
byte
array stored in the default data entry.TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.byte[] extractByteArray(String tag) throws BadParameter, TypeMismatch
byte
array stored in the specified data entry.BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than a byte
array,
or nothing.boolean extractBoolean() throws TypeMismatch
boolean
stored in the default data entry.TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.boolean extractBoolean(String tag) throws BadParameter, TypeMismatch
boolean
stored in the specified data entry.BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than a boolean
,
or nothing.boolean[] extractBooleanArray() throws TypeMismatch
boolean
array stored in the default data entry.TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.boolean[] extractBooleanArray(String tag) throws BadParameter, TypeMismatch
boolean
array stored in the specified data entry.BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than a boolean
array,
or nothing.String extractString() throws TypeMismatch
String
stored in the default data entry.TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.String extractString(String tag) throws BadParameter, TypeMismatch
String
stored in the specified data entry.BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than a String
,
or nothing.String[] extractStringArray() throws TypeMismatch
String
array stored in the default data entry.TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.String[] extractStringArray(String tag) throws BadParameter, TypeMismatch
String
array stored in the specified data entry.BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than a String
array,
or nothing.DipTimestamp extractDipTime()
DipTimestamp
of this DipData object. This should represent the time at which the
value(s) contained in this object were obtained.int extractDataQuality()
DipQualityEnum extractDataQualityEnum()
String extractQualityString()
int getValueType()
TYPE_NULL
,
TYPE_BOOLEAN
,
TYPE_BOOLEAN_ARRAY
,
TYPE_BYTE
,
TYPE_BYTE_ARRAY
,
TYPE_SHORT
,
TYPE_SHORT_ARRAY
,
TYPE_INT
,
TYPE_INT_ARRAY
,
TYPE_LONG
,
TYPE_LONG_ARRAY
,
TYPE_FLOAT
,
TYPE_FLOAT_ARRAY
,
TYPE_DOUBLE
,
TYPE_DOUBLE_ARRAY
,
TYPE_STRING
,
Will return TYPE_NULL if the object is holding complex data (tag/value pairs)
int getValueType(String tag)
tag
- - the name of the field this method is to find the type of.getValueType()
Copyright © 2008–2017 CERN. All rights reserved.