Package cern.dip
Interface DipData
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
DipDataImp
,MockDipData
public interface DipData extends java.io.Serializable
Interface for DIP data. DipData object are used by publishers to publish complex data types. These object are arecreated
by theDIP
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 - void insert(X x)
This method allows the insertion of a value of type X as a default entry. - void insert(String tag, X x)
This method allows the insertion of a value of type X as the entry named bytag
. - X extractX()
This method allows the extraction of a value of type X from the default entry. - X extractX(String tag)
This method allows the extraction of a value of type X from the entry named bytag
.
-
-
Field Summary
Fields Modifier and Type Field Description static int
TYPE_BOOLEAN
Indicates aboolean
value.static int
TYPE_BOOLEAN_ARRAY
Indicates aboolean
array value.static int
TYPE_BYTE
Indicates abyte
value.static int
TYPE_BYTE_ARRAY
Indicates abyte
array value.static int
TYPE_DOUBLE
Indicates adouble
value.static int
TYPE_DOUBLE_ARRAY
Indicates adouble
array value.static int
TYPE_FLOAT
Indicates afloat
value.static int
TYPE_FLOAT_ARRAY
Indicates afloat
array value.static int
TYPE_INT
Indicates anint
value.static int
TYPE_INT_ARRAY
Indicates anint
array value.static int
TYPE_LONG
Indicates along
value.static int
TYPE_LONG_ARRAY
Indicates along
array value.static int
TYPE_NULL
Indicates an empty entry.static int
TYPE_SHORT
Indicates ashort
value.static int
TYPE_SHORT_ARRAY
Indicates ashort
array value.static int
TYPE_STRING
Indicates aString
value.static int
TYPE_STRING_ARRAY
Indicates aString
array value.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
contains(java.lang.String tag)
Returnstrue
if this object contains an entry with the specified tag.boolean
extractBoolean()
Returns theboolean
stored in the default data entry.boolean
extractBoolean(java.lang.String tag)
Returns theboolean
stored in the specified data entry.boolean[]
extractBooleanArray()
Returns theboolean
array stored in the default data entry.boolean[]
extractBooleanArray(java.lang.String tag)
Returns theboolean
array stored in the specified data entry.byte
extractByte()
Returns thebyte
stored in the default data entry.byte
extractByte(java.lang.String tag)
Returns thebyte
stored in the specified data entry.byte[]
extractByteArray()
Returns thebyte
array stored in the default data entry.byte[]
extractByteArray(java.lang.String tag)
Returns thebyte
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 theDipTimestamp
of this DipData object.double
extractDouble()
Returns thefloat
array stored in the default data entry.double
extractDouble(java.lang.String tag)
Returns thefloat
array stored in the default data entry.double[]
extractDoubleArray()
Returns thedouble
array stored in the default data entry.double[]
extractDoubleArray(java.lang.String tag)
Returns thedouble
array stored in the specified data entry.float
extractFloat()
Extracts the default value from the DipData object as a float.float
extractFloat(java.lang.String tag)
Returns thefloat
stored in the specified data entry.float[]
extractFloatArray()
Returns thedouble
stored in the default data entry.float[]
extractFloatArray(java.lang.String tag)
Returns thefloat
array stored in the specified data entry.int
extractInt()
Returns theint
stored in the default data entry.int
extractInt(java.lang.String tag)
Returns theint
stored in the specified data entry.int[]
extractIntArray()
Returns theint
array stored in the default data entry.int[]
extractIntArray(java.lang.String tag)
Returns theint
array stored in the specified data entry.long
extractLong()
Returns thelong
stored in the default data entry.long
extractLong(java.lang.String tag)
Returns thelong
stored in the specified data entry.long[]
extractLongArray()
Returns thelong
array stored in the default data entry.long[]
extractLongArray(java.lang.String tag)
Returns thelong
array stored in the specified data entry.java.lang.String
extractQualityString()
Extracts the string that describes the reason for the quality.short
extractShort()
Returns theshort
stored in the default data entry.short
extractShort(java.lang.String tag)
Returns theshort
stored in the specified data entry.short[]
extractShortArray()
Returns theshort
array stored in the default data entry.short[]
extractShortArray(java.lang.String tag)
Returns theshort
array stored in the specified data entry.java.lang.String
extractString()
Returns theString
stored in the default data entry.java.lang.String
extractString(java.lang.String tag)
Returns theString
stored in the specified data entry.java.lang.String[]
extractStringArray()
Returns theString
array stored in the default data entry.java.lang.String[]
extractStringArray(java.lang.String tag)
Returns theString
array stored in the specified data entry.java.util.Optional<java.lang.Object>
getPrimitiveValueAsObject()
Returns the primitive DipData value as a Java Object.java.lang.String[]
getTags()
Returns an unordered String array that contains tags of all entries.java.util.Map<java.lang.String,java.lang.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(java.lang.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(java.lang.String value)
Inserts a String as default value into the DipData object.void
insert(java.lang.String[] value)
Inserts a String array as default value into the DipData object.void
insert(java.lang.String tag, boolean value)
Inserts a named boolean entry into the DipData object.void
insert(java.lang.String tag, boolean[] value)
Inserts a named boolean array entry into the DipData object.void
insert(java.lang.String tag, byte value)
Inserts a named byte entry into the DipData object.void
insert(java.lang.String tag, byte[] value)
Inserts a named byte array entry into the DipData object.void
insert(java.lang.String tag, double value)
Inserts a named double entry into the DipData object.void
insert(java.lang.String tag, double[] value)
Inserts a named double array entry into the DipData object.void
insert(java.lang.String tag, float value)
Inserts a named float entry into the DipData object.void
insert(java.lang.String tag, float[] value)
Inserts a named float array entry into the DipData object.void
insert(java.lang.String tag, int value)
Inserts a named int entry into the DipData object.void
insert(java.lang.String tag, int[] value)
Inserts a named int array entry into the DipData object.void
insert(java.lang.String tag, long value)
Inserts a named long entry into the DipData object.void
insert(java.lang.String tag, long[] value)
Inserts a named long array entry into the DipData object.void
insert(java.lang.String tag, short value)
Inserts a named short entry into the DipData object.void
insert(java.lang.String tag, short[] value)
Inserts a named short array entry into the DipData object.void
insert(java.lang.String tag, java.lang.String value)
Inserts a named String entry into the DipData object.void
insert(java.lang.String tag, java.lang.String[] value)
Inserts a named String array entry into the DipData object.boolean
isEmpty()
Returnstrue
if this DipData contains no entries;false
otherwise.boolean
isPrimitive()
Indicates whether the DipData package only carries a single value (as opposed to one or more fields, a.k.a.int
size()
Returns the number of entries in this object.
-
-
-
Field Detail
-
TYPE_NULL
static final int TYPE_NULL
Indicates an empty entry. Can be useful for implementations of this interface.- See Also:
- Constant Field Values
-
TYPE_BOOLEAN
static final int TYPE_BOOLEAN
Indicates aboolean
value.- See Also:
- Constant Field Values
-
TYPE_BOOLEAN_ARRAY
static final int TYPE_BOOLEAN_ARRAY
Indicates aboolean
array value.- See Also:
- Constant Field Values
-
TYPE_BYTE
static final int TYPE_BYTE
Indicates abyte
value.- See Also:
- Constant Field Values
-
TYPE_BYTE_ARRAY
static final int TYPE_BYTE_ARRAY
Indicates abyte
array value.- See Also:
- Constant Field Values
-
TYPE_SHORT
static final int TYPE_SHORT
Indicates ashort
value.- See Also:
- Constant Field Values
-
TYPE_SHORT_ARRAY
static final int TYPE_SHORT_ARRAY
Indicates ashort
array value.- See Also:
- Constant Field Values
-
TYPE_INT
static final int TYPE_INT
Indicates anint
value.- See Also:
- Constant Field Values
-
TYPE_INT_ARRAY
static final int TYPE_INT_ARRAY
Indicates anint
array value.- See Also:
- Constant Field Values
-
TYPE_LONG
static final int TYPE_LONG
Indicates along
value.- See Also:
- Constant Field Values
-
TYPE_LONG_ARRAY
static final int TYPE_LONG_ARRAY
Indicates along
array value.- See Also:
- Constant Field Values
-
TYPE_FLOAT
static final int TYPE_FLOAT
Indicates afloat
value.- See Also:
- Constant Field Values
-
TYPE_FLOAT_ARRAY
static final int TYPE_FLOAT_ARRAY
Indicates afloat
array value.- See Also:
- Constant Field Values
-
TYPE_DOUBLE
static final int TYPE_DOUBLE
Indicates adouble
value.- See Also:
- Constant Field Values
-
TYPE_DOUBLE_ARRAY
static final int TYPE_DOUBLE_ARRAY
Indicates adouble
array value.- See Also:
- Constant Field Values
-
TYPE_STRING
static final int TYPE_STRING
Indicates aString
value.- See Also:
- Constant Field Values
-
TYPE_STRING_ARRAY
static final int TYPE_STRING_ARRAY
Indicates aString
array value.- See Also:
- Constant Field Values
-
-
Method Detail
-
isEmpty
boolean isEmpty()
Returnstrue
if this DipData contains no entries;false
otherwise.
-
size
int size()
Returns the number of entries in this object.
-
getTags
java.lang.String[] getTags()
Returns an unordered String array that contains tags of all entries. Returns a zero length array if this object is empty.
-
contains
boolean contains(java.lang.String tag)
Returnstrue
if this object contains an entry with the specified tag.
-
insert
void insert(float value) throws TypeMismatch
Inserts a float as default value into the DipData object. If the default value already exists, it will be overwritten.- Parameters:
value
- - the value to be written- Throws:
TypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.
-
insert
void insert(java.lang.String tag, float value) throws TypeMismatch
Inserts a named float entry into the DipData object. If the entry already exists, it will be overwritten.- Parameters:
tag
- - name of the 'field' the value belongs to.value
- - the value to be written- Throws:
TypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.
-
insert
void insert(double value) throws TypeMismatch
Inserts a double as default value into the DipData object. If the default value already exists, it will be overwritten.- Parameters:
value
- - the value to be written- Throws:
TypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.
-
insert
void insert(java.lang.String tag, double value) throws TypeMismatch
Inserts a named double entry into the DipData object. If the entry already exists, it will be overwritten.- Parameters:
tag
- - name of the 'field' the value belongs to.value
- - the value to be written- Throws:
TypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.
-
insert
void insert(float[] value) throws TypeMismatch
Inserts a float array as default value into the DipData object. If the default value already exists, it will be overwritten.- Parameters:
value
- - the value to be written- Throws:
TypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.
-
insert
void insert(java.lang.String tag, float[] value) throws TypeMismatch
Inserts a named float array entry into the DipData object. If the entry already exists, it will be overwritten.- Parameters:
tag
- - name of the 'field' the value belongs to.value
- - the value to be written- Throws:
TypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.
-
insert
void insert(double[] value) throws TypeMismatch
Inserts a double array as default value into the DipData object. If the default value already exists, it will be overwritten.- Parameters:
value
- - the value to be written- Throws:
TypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.
-
insert
void insert(java.lang.String tag, double[] value) throws TypeMismatch
Inserts a named double array entry into the DipData object. If the entry already exists, it will be overwritten.- Parameters:
tag
- - name of the 'field' the value belongs to.value
- - the value to be written- Throws:
TypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.
-
insert
void insert(short value) throws TypeMismatch
Inserts a short as default value into the DipData object. If the default value already exists, it will be overwritten.- Parameters:
value
- - the value to be written- Throws:
TypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.
-
insert
void insert(java.lang.String tag, short value) throws TypeMismatch
Inserts a named short entry into the DipData object. If the entry already exists, it will be overwritten.- Parameters:
tag
- - name of the 'field' the value belongs to.value
- - the value to be written- Throws:
TypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.
-
insert
void insert(short[] value) throws TypeMismatch
Inserts an short array as default value into the DipData object. If the default value already exists, it will be overwritten.- Parameters:
value
- - the value to be written- Throws:
TypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.
-
insert
void insert(java.lang.String tag, short[] value) throws TypeMismatch
Inserts a named short array entry into the DipData object. If the entry already exists, it will be overwritten.- Parameters:
tag
- - name of the 'field' the value belongs to.value
- - the value to be written- Throws:
TypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.
-
insert
void insert(int value) throws TypeMismatch
Inserts an int as default value into the DipData object. If the default value already exists, it will be overwritten.- Parameters:
value
- - the value to be written- Throws:
TypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.
-
insert
void insert(java.lang.String tag, int value) throws TypeMismatch
Inserts a named int entry into the DipData object. If the entry already exists, it will be overwritten.- Parameters:
tag
- - name of the 'field' the value belongs to.value
- - the value to be written- Throws:
TypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.
-
insert
void insert(int[] value) throws TypeMismatch
Inserts an int array as default value into the DipData object. If the default value already exists, it will be overwritten.- Parameters:
value
- - the value to be written- Throws:
TypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.
-
insert
void insert(java.lang.String tag, int[] value) throws TypeMismatch
Inserts a named int array entry into the DipData object. If the entry already exists, it will be overwritten.- Parameters:
tag
- - name of the 'field' the value belongs to.value
- - the value to be written- Throws:
TypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.
-
insert
void insert(long value) throws TypeMismatch
Inserts a long as default value into the DipData object. If the default value already exists, it will be overwritten.- Parameters:
value
- - the value to be written- Throws:
TypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.
-
insert
void insert(java.lang.String tag, long value) throws TypeMismatch
Inserts a named long entry into the DipData object. If the entry already exists, it will be overwritten.- Parameters:
tag
- - name of the 'field' the value belongs to.value
- - the value to be written- Throws:
TypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.
-
insert
void insert(long[] value) throws TypeMismatch
Inserts a long array as default value into the DipData object. If the default value already exists, it will be overwritten.- Parameters:
value
- - the value to be written- Throws:
TypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.
-
insert
void insert(java.lang.String tag, long[] value) throws TypeMismatch
Inserts a named long array entry into the DipData object. If the entry already exists, it will be overwritten.- Parameters:
tag
- - name of the 'field' the value belongs to.value
- - the value to be written- Throws:
TypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.
-
insert
void insert(byte value) throws TypeMismatch
Inserts a byte as default value into the DipData object. If the default value already exists, it will be overwritten.- Parameters:
value
- - the value to be written- Throws:
TypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.
-
insert
void insert(java.lang.String tag, byte value) throws TypeMismatch
Inserts a named byte entry into the DipData object. If the entry already exists, it will be overwritten.- Parameters:
tag
- - name of the 'field' the value belongs to.value
- - the value to be written- Throws:
TypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.
-
insert
void insert(byte[] value) throws TypeMismatch
Inserts a byte array as default value into the DipData object. If the default value already exists, it will be overwritten.- Parameters:
value
- - the value to be written- Throws:
TypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.
-
insert
void insert(java.lang.String tag, byte[] value) throws TypeMismatch
Inserts a named byte array entry into the DipData object. If the entry already exists, it will be overwritten.- Parameters:
tag
- - name of the 'field' the value belongs to.value
- - the value to be written- Throws:
TypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.
-
insert
void insert(boolean value) throws TypeMismatch
Inserts a boolean as default value into the DipData object. If the default value already exists, it will be overwritten.- Parameters:
value
- - the value to be written- Throws:
TypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.
-
insert
void insert(java.lang.String tag, boolean value) throws TypeMismatch
Inserts a named boolean entry into the DipData object. If the entry already exists, it will be overwritten.- Parameters:
tag
- - name of the 'field' the value belongs to.value
- - the value to be written- Throws:
TypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.
-
insert
void insert(boolean[] value) throws TypeMismatch
Inserts a boolean array as default value into the DipData object. If the default value already exists, it will be overwritten.- Parameters:
value
- - the value to be written- Throws:
TypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.
-
insert
void insert(java.lang.String tag, boolean[] value) throws TypeMismatch
Inserts a named boolean array entry into the DipData object. If the entry already exists, it will be overwritten.- Parameters:
tag
- - name of the 'field' the value belongs to.value
- - the value to be written- Throws:
TypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.
-
insert
void insert(java.lang.String value) throws TypeMismatch
Inserts a String as default value into the DipData object. If the default value already exists, it will be overwritten.- Parameters:
value
- - the value to be written- Throws:
TypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.
-
insert
void insert(java.lang.String tag, java.lang.String value) throws TypeMismatch
Inserts a named String entry into the DipData object. If the entry already exists, it will be overwritten.- Parameters:
tag
- - name of the 'field' the value belongs to.value
- - the value to be written- Throws:
TypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.
-
insert
void insert(java.lang.String[] value) throws TypeMismatch
Inserts a String array as default value into the DipData object. If the default value already exists, it will be overwritten.- Parameters:
value
- - the value to be written- Throws:
TypeMismatch
- if entry is complex or contains a default value which is not of the same type as value.
-
insert
void insert(java.lang.String tag, java.lang.String[] value) throws TypeMismatch
Inserts a named String array entry into the DipData object. If the entry already exists, it will be overwritten.- Parameters:
tag
- - name of the 'field' the value belongs to.value
- - the value to be written- Throws:
TypeMismatch
- if entry is simple or contains a tag already exists and its corresponding data is not of the same type as value.
-
extractFloat
float extractFloat() throws TypeMismatch
Extracts the default value from the DipData object as a float.- Throws:
TypeMismatch
-
extractFloat
float extractFloat(java.lang.String tag) throws BadParameter, TypeMismatch
Returns thefloat
stored in the specified data entry.- Throws:
BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than afloat
, or nothing.
-
extractFloatArray
float[] extractFloatArray(java.lang.String tag) throws BadParameter, TypeMismatch
Returns thefloat
array stored in the specified data entry.- Throws:
BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than afloat
array, or nothing.
-
extractFloatArray
float[] extractFloatArray() throws TypeMismatch
Returns thedouble
stored in the default data entry.- Throws:
TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.
-
extractDouble
double extractDouble() throws TypeMismatch
Returns thefloat
array stored in the default data entry.- Throws:
TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.
-
extractDouble
double extractDouble(java.lang.String tag) throws BadParameter, TypeMismatch
Returns thefloat
array stored in the default data entry.- Throws:
BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than adouble
array, or nothing.
-
extractDoubleArray
double[] extractDoubleArray() throws TypeMismatch
Returns thedouble
array stored in the default data entry.- Throws:
TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.
-
extractDoubleArray
double[] extractDoubleArray(java.lang.String tag) throws BadParameter, TypeMismatch
Returns thedouble
array stored in the specified data entry.- Throws:
BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than adouble
array, or nothing.
-
extractShort
short extractShort() throws TypeMismatch
Returns theshort
stored in the default data entry.- Throws:
TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.
-
extractShort
short extractShort(java.lang.String tag) throws BadParameter, TypeMismatch
Returns theshort
stored in the specified data entry.- Throws:
BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than ashort
, or nothing.
-
extractShortArray
short[] extractShortArray() throws TypeMismatch
Returns theshort
array stored in the default data entry.- Throws:
TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.
-
extractShortArray
short[] extractShortArray(java.lang.String tag) throws BadParameter, TypeMismatch
Returns theshort
array stored in the specified data entry.- Throws:
BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than ashort
array, or nothing.
-
extractInt
int extractInt() throws TypeMismatch
Returns theint
stored in the default data entry.- Throws:
TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.
-
extractInt
int extractInt(java.lang.String tag) throws BadParameter, TypeMismatch
Returns theint
stored in the specified data entry.- Throws:
BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than aint
, or nothing.
-
extractIntArray
int[] extractIntArray() throws TypeMismatch
Returns theint
array stored in the default data entry.- Throws:
TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.
-
extractIntArray
int[] extractIntArray(java.lang.String tag) throws BadParameter, TypeMismatch
Returns theint
array stored in the specified data entry.- Throws:
BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than aint
array, or nothing.
-
extractLong
long extractLong() throws TypeMismatch
Returns thelong
stored in the default data entry.- Throws:
TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.
-
extractLong
long extractLong(java.lang.String tag) throws BadParameter, TypeMismatch
Returns thelong
stored in the specified data entry.- Throws:
BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than along
, or nothing.
-
extractLongArray
long[] extractLongArray() throws TypeMismatch
Returns thelong
array stored in the default data entry.- Throws:
TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.
-
extractLongArray
long[] extractLongArray(java.lang.String tag) throws BadParameter, TypeMismatch
Returns thelong
array stored in the specified data entry.- Throws:
BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than along
array, or nothing.
-
extractByte
byte extractByte() throws TypeMismatch
Returns thebyte
stored in the default data entry.- Throws:
TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.
-
extractByte
byte extractByte(java.lang.String tag) throws BadParameter, TypeMismatch
Returns thebyte
stored in the specified data entry.- Throws:
BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than abyte
, or nothing.
-
extractByteArray
byte[] extractByteArray() throws TypeMismatch
Returns thebyte
array stored in the default data entry.- Throws:
TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.
-
extractByteArray
byte[] extractByteArray(java.lang.String tag) throws BadParameter, TypeMismatch
Returns thebyte
array stored in the specified data entry.- Throws:
BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than abyte
array, or nothing.
-
extractBoolean
boolean extractBoolean() throws TypeMismatch
Returns theboolean
stored in the default data entry.- Throws:
TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.
-
extractBoolean
boolean extractBoolean(java.lang.String tag) throws BadParameter, TypeMismatch
Returns theboolean
stored in the specified data entry.- Throws:
BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than aboolean
, or nothing.
-
extractBooleanArray
boolean[] extractBooleanArray() throws TypeMismatch
Returns theboolean
array stored in the default data entry.- Throws:
TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.
-
extractBooleanArray
boolean[] extractBooleanArray(java.lang.String tag) throws BadParameter, TypeMismatch
Returns theboolean
array stored in the specified data entry.- Throws:
BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than aboolean
array, or nothing.
-
extractString
java.lang.String extractString() throws TypeMismatch
Returns theString
stored in the default data entry.- Throws:
TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.
-
extractString
java.lang.String extractString(java.lang.String tag) throws BadParameter, TypeMismatch
Returns theString
stored in the specified data entry.- Throws:
BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than aString
, or nothing.
-
extractStringArray
java.lang.String[] extractStringArray() throws TypeMismatch
Returns theString
array stored in the default data entry.- Throws:
TypeMismatch
- if 1) the object is holding complex data or 2) the value held is not of the required type.
-
extractStringArray
java.lang.String[] extractStringArray(java.lang.String tag) throws BadParameter, TypeMismatch
Returns theString
array stored in the specified data entry.- Throws:
BadParameter
- if this DipData does not contain the specified entryTypeMismatch
- if the entry contains something other than aString
array, or nothing.
-
extractDipTime
DipTimestamp extractDipTime()
Returns theDipTimestamp
of this DipData object. This should represent the time at which the value(s) contained in this object were obtained.
-
extractDataQuality
int extractDataQuality()
Returns the data quality value of this DipData object as an int. The data quality can be one of:
-
extractDataQualityEnum
DipQualityEnum extractDataQualityEnum()
-
extractQualityString
java.lang.String extractQualityString()
Extracts the string that describes the reason for the quality.
-
getValueType
int getValueType()
Returns type code for the value contained in the default entry. The return value can be one of the TYPE_X constants defined in this interface.- See Also:
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)
-
getValueType
int getValueType(java.lang.String tag)
Returns type code for the value contained in the specified entry. The return value can be one of the TYPE_X constants defined in this interface. Will return TYPE_NULL if the tag name passed does not exist.- Parameters:
tag
- - the name of the field this method is to find the type of.- See Also:
getValueType()
-
getValueAsMap
java.util.Map<java.lang.String,java.lang.Object> getValueAsMap() throws java.lang.Exception
Returns the contents of the DipData as a field name / value map.- Returns:
- A map associating the field name to its value.
- Throws:
java.lang.Exception
-
isPrimitive
boolean isPrimitive()
Indicates whether the DipData package only carries a single value (as opposed to one or more fields, a.k.a. key/value pairs)- Returns:
true
if the DipData package carries a single value with a default field name.
-
getPrimitiveValueAsObject
java.util.Optional<java.lang.Object> getPrimitiveValueAsObject()
Returns the primitive DipData value as a Java Object.- Returns:
- the primitive value or an empty
Optional
if the data payload is not a carrying a single value.
-
-