|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcern.cmw.DataEntry
public class DataEntry
Objects of this class serve as containers that can hold a value of different types. The contained values can be single instances or single-dimensional arrays of the types listed in the table below. A DataEntry object stores the value type code along with the value. Since the data entry objects can be passed between C++ and Java applications, the table provides also the correspondance between C++ and Java types.
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 |
Field Summary | |
---|---|
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 that a DataEntry does not contain anything. |
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. |
Constructor Summary | |
---|---|
DataEntry()
Creates an empty DataEntry. |
Method Summary | |
---|---|
DataEntry |
copy()
Creates and returns a copy of this DataEntry. |
boolean |
equals(DataEntry entry)
Returns true if this DataEntry has the same contents
(same data type and same value) as the specified entry; false
otherwise. |
boolean |
extractBoolean()
Returns the boolean stored in this DataEntry object. |
boolean[] |
extractBooleanArray()
Returns the boolean array stored in this DataEntry object. |
byte |
extractByte()
Returns the byte stored in this DataEntry object. |
byte[] |
extractByteArray()
Returns the byte array stored in this DataEntry object. |
double |
extractDouble()
Returns the double stored in this DataEntry object. |
double[] |
extractDoubleArray()
Returns the double array stored in this DataEntry object. |
float |
extractFloat()
Returns the float stored in this DataEntry object. |
float[] |
extractFloatArray()
Returns the float array stored in this DataEntry object. |
int |
extractInt()
Returns the int stored in this DataEntry object. |
int[] |
extractIntArray()
Returns the int array stored in this DataEntry object. |
long |
extractLong()
Returns the long stored in this DataEntry object. |
long[] |
extractLongArray()
Returns the long array stored in this DataEntry object. |
Object |
extractObject()
Returns the Object internally stored. |
short |
extractShort()
Returns the short stored in this DataEntry object. |
short[] |
extractShortArray()
Returns the short array stored in this DataEntry object. |
String |
extractString()
Returns the String stored in this DataEntry object. |
String[] |
extractStringArray()
Returns the String array stored in this DataEntry object. |
int |
getValueType()
Returns type code for the value contained in this DataEntry object. |
void |
insert(boolean value)
Inserts a boolean value into this DataEntry object. |
void |
insert(boolean[] value)
Inserts a boolean array value into this DataEntry object. |
void |
insert(byte value)
Inserts a byte value into this DataEntry object. |
void |
insert(byte[] value)
Inserts a byte array value into this DataEntry object. |
void |
insert(double value)
Inserts a double value into this DataEntry object. |
void |
insert(double[] value)
Inserts a double array value into this DataEntry object. |
void |
insert(float value)
Inserts a float value into this DataEntry object. |
void |
insert(float[] value)
Inserts a float array value into this DataEntry object. |
void |
insert(int value)
Inserts an int value into this DataEntry object. |
void |
insert(int[] value)
Inserts an int array value into this DataEntry object. |
void |
insert(long value)
Inserts a long value into this DataEntry object. |
void |
insert(long[] value)
Inserts a long array value into this DataEntry object. |
void |
insert(Object val)
Inserts an Object into this DataEntry, after checking that it is of one of the allowable types (Boolean, Byte, Short, Integer, Long, Float, Double, String) or arrays thereof. |
void |
insert(short value)
Inserts a short value into this DataEntry object. |
void |
insert(short[] value)
Inserts a short array value into this DataEntry object. |
void |
insert(String value)
Inserts a String value into this DataEntry object. |
void |
insert(String[] value)
Inserts a String array value into this DataEntry object. |
String |
toString()
Returns a string representation of this DataEntry object. |
String |
toString(int maxElements)
Returns a string representation of this DataEntry object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int TYPE_NULL
public static final int TYPE_BOOLEAN
boolean
value.
public static final int TYPE_BOOLEAN_ARRAY
boolean
array value.
public static final int TYPE_BYTE
byte
value.
public static final int TYPE_BYTE_ARRAY
byte
array value.
public static final int TYPE_SHORT
short
value.
public static final int TYPE_SHORT_ARRAY
short
array value.
public static final int TYPE_INT
int
value.
public static final int TYPE_INT_ARRAY
int
array value.
public static final int TYPE_LONG
long
value.
public static final int TYPE_LONG_ARRAY
long
array value.
public static final int TYPE_FLOAT
float
value.
public static final int TYPE_FLOAT_ARRAY
float
array value.
public static final int TYPE_DOUBLE
double
value.
public static final int TYPE_DOUBLE_ARRAY
double
array value.
public static final int TYPE_STRING
String
value.
public static final int TYPE_STRING_ARRAY
String
array value.
Constructor Detail |
---|
public DataEntry()
Method Detail |
---|
public DataEntry copy()
public boolean equals(DataEntry entry)
true
if this DataEntry has the same contents
(same data type and same value) as the specified entry; false
otherwise. Always returns false
if the entry argument is
null
public void insert(boolean value)
boolean
value into this DataEntry object.
public void insert(byte value)
byte
value into this DataEntry object.
public void insert(short value)
short
value into this DataEntry object.
public void insert(int value)
int
value into this DataEntry object.
public void insert(long value)
long
value into this DataEntry object.
public void insert(float value)
float
value into this DataEntry object.
public void insert(double value)
double
value into this DataEntry object.
public void insert(String value)
String
value into this DataEntry object.
public void insert(boolean[] value)
boolean
array value into this DataEntry object.
public void insert(byte[] value)
byte
array value into this DataEntry object.
public void insert(short[] value)
short
array value into this DataEntry object.
public void insert(int[] value)
int
array value into this DataEntry object.
public void insert(long[] value)
long
array value into this DataEntry object.
public void insert(float[] value)
float
array value into this DataEntry object.
public void insert(double[] value)
double
array value into this DataEntry object.
public void insert(String[] value)
String
array value into this DataEntry object.
public 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
,
TYPE_STRING_ARRAY
public boolean extractBoolean() throws TypeMismatch
boolean
stored in this DataEntry object.
TypeMismatch
- thrown if this DataEntry contains something other than a boolean
,
or nothing.public boolean[] extractBooleanArray() throws TypeMismatch
boolean
array stored in this DataEntry object.
TypeMismatch
- thrown if this DataEntry contains something other than a boolean
array, or nothing.public byte extractByte() throws TypeMismatch
byte
stored in this DataEntry object.
TypeMismatch
- thrown if this DataEntry contains something other than a byte
,
or nothing.public byte[] extractByteArray() throws TypeMismatch
byte
array stored in this DataEntry object.
TypeMismatch
- thrown if this DataEntry contains something other than a byte
array, or nothing.public short extractShort() throws TypeMismatch
short
stored in this DataEntry object.
TypeMismatch
- thrown if this DataEntry contains something other than a short
,
or nothing.public short[] extractShortArray() throws TypeMismatch
short
array stored in this DataEntry object.
TypeMismatch
- thrown if this DataEntry contains something other than a short
array, or nothing.public int extractInt() throws TypeMismatch
int
stored in this DataEntry object.
TypeMismatch
- thrown if this DataEntry contains something other than an int
,
or nothing.public int[] extractIntArray() throws TypeMismatch
int
array stored in this DataEntry object.
TypeMismatch
- thrown if this DataEntry contains something other than an int
array or nothing.public long extractLong() throws TypeMismatch
long
stored in this DataEntry object.
TypeMismatch
- thrown if this DataEntry contains something other than a long
,
or nothing.public long[] extractLongArray() throws TypeMismatch
long
array stored in this DataEntry object.
TypeMismatch
- thrown if this DataEntry contains something other than a long
array, or nothing.public float extractFloat() throws TypeMismatch
float
stored in this DataEntry object.
TypeMismatch
- thrown if this DataEntry contains something other than a float
,
or nothing.public float[] extractFloatArray() throws TypeMismatch
float
array stored in this DataEntry object.
TypeMismatch
- thrown if this DataEntry contains something other than a float
array or nothing.public double extractDouble() throws TypeMismatch
double
stored in this DataEntry object.
TypeMismatch
- thrown if this DataEntry contains something other than a double
,
or nothing.public double[] extractDoubleArray() throws TypeMismatch
double
array stored in this DataEntry object.
TypeMismatch
- thrown if this DataEntry contains something other than a double
array or nothing.public String extractString() throws TypeMismatch
String
stored in this DataEntry object.
TypeMismatch
- thrown if this DataEntry contains something other than a String
,
or nothing.public String[] extractStringArray() throws TypeMismatch
String
array stored in this DataEntry object.
TypeMismatch
- thrown if this DataEntry contains something other than a String
array or nothing.public void insert(Object val) throws IllegalArgumentException
IllegalArgumentException
- thrown if the inserted value is not of one of the supported types.public Object extractObject()
public String toString()
toString(100)
.
toString
in class Object
toString(int)
public String toString(int maxElements)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |