Package db
Class BinaryCodedField
- java.lang.Object
- 
- db.Field
- 
- db.BinaryField
- 
- db.BinaryCodedField
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Comparable<Field>
 
 public class BinaryCodedField extends BinaryField Allows various non-database supported data types to be encoded within a BinaryField which may be stored within the database.Although the BinaryField stores a byte array, this type is supported by this class so that the use of a BinaryField within a table can always relate to this class and still support a byte array. 
- 
- 
Field SummaryFields Modifier and Type Field Description static byteBYTE_ARRAYbyte[] data typestatic byteDOUBLEdouble data typestatic byteDOUBLE_ARRAYdouble[] data typestatic byteFLOATfloat data typestatic byteFLOAT_ARRAYfloat[] data typestatic byteINT_ARRAYint[] data typestatic byteLONG_ARRAYlong[] data typestatic byteSHORT_ARRAYshort data typestatic byteSTRING_ARRAYString[] data type- 
Fields inherited from class db.BinaryFielddata
 
- 
 - 
Constructor SummaryConstructors Constructor Description BinaryCodedField(byte[] values)Construct a coded field from a byte array.BinaryCodedField(double value)Construct a coded field from a double value.BinaryCodedField(double[] values)Construct a coded field from a double array.BinaryCodedField(float value)Construct a coded field from a float value.BinaryCodedField(float[] values)Construct a coded field from a float array.BinaryCodedField(int[] values)Construct a coded field from a int array.BinaryCodedField(long[] values)Construct a coded field from a long array.BinaryCodedField(short[] values)Construct a coded field from a short array.BinaryCodedField(BinaryField binField)Construct a coded field from an existing binary field.BinaryCodedField(java.lang.String[] strings)Construct a coded field from a String array.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getByteArray()Get the byte array contained with this field.bytegetDataType()Get the data type associated with this field.double[]getDoubleArray()Get the double array contained with this field.doublegetDoubleValue()Get the double value contained with this field.float[]getFloatArray()Get the float array contained with this field.floatgetFloatValue()Get the float value contained with this field.int[]getIntArray()Get the int array contained with this field.long[]getLongArray()Get the long array contained with this field.short[]getShortArray()Get the short array contained with this field.java.lang.String[]getStringArray()Get the String array contained with this field.- 
Methods inherited from class db.BinaryFieldcompareTo, equals, getBinaryData, getFieldType, getValueAsString, hashCode, isVariableLength, newField, newField, setBinaryData, toString
 - 
Methods inherited from class db.FieldgetBooleanValue, getByteValue, getIntValue, getLongValue, getShortValue, getString, setBooleanValue, setByteValue, setIntValue, setLongValue, setShortValue, setString
 
- 
 
- 
- 
- 
Field Detail- 
BYTE_ARRAYpublic static final byte BYTE_ARRAY byte[] data type- See Also:
- Constant Field Values
 
 - 
FLOATpublic static final byte FLOAT float data type- See Also:
- Constant Field Values
 
 - 
DOUBLEpublic static final byte DOUBLE double data type- See Also:
- Constant Field Values
 
 - 
SHORT_ARRAYpublic static final byte SHORT_ARRAY short data type- See Also:
- Constant Field Values
 
 - 
INT_ARRAYpublic static final byte INT_ARRAY int[] data type- See Also:
- Constant Field Values
 
 - 
LONG_ARRAYpublic static final byte LONG_ARRAY long[] data type- See Also:
- Constant Field Values
 
 - 
FLOAT_ARRAYpublic static final byte FLOAT_ARRAY float[] data type- See Also:
- Constant Field Values
 
 - 
DOUBLE_ARRAYpublic static final byte DOUBLE_ARRAY double[] data type- See Also:
- Constant Field Values
 
 - 
STRING_ARRAYpublic static final byte STRING_ARRAY String[] data type- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
BinaryCodedFieldpublic BinaryCodedField(BinaryField binField) Construct a coded field from an existing binary field.- Parameters:
- binary- field
 
 - 
BinaryCodedFieldpublic BinaryCodedField(double value) Construct a coded field from a double value.- Parameters:
- value-
 
 - 
BinaryCodedFieldpublic BinaryCodedField(float value) Construct a coded field from a float value.- Parameters:
- value-
 
 - 
BinaryCodedFieldpublic BinaryCodedField(byte[] values) Construct a coded field from a byte array.- Parameters:
- values- byte array
 
 - 
BinaryCodedFieldpublic BinaryCodedField(short[] values) Construct a coded field from a short array.- Parameters:
- values- short array
 
 - 
BinaryCodedFieldpublic BinaryCodedField(int[] values) Construct a coded field from a int array.- Parameters:
- values- int array
 
 - 
BinaryCodedFieldpublic BinaryCodedField(long[] values) Construct a coded field from a long array.- Parameters:
- values- long array
 
 - 
BinaryCodedFieldpublic BinaryCodedField(float[] values) Construct a coded field from a float array.- Parameters:
- values- float array
 
 - 
BinaryCodedFieldpublic BinaryCodedField(double[] values) Construct a coded field from a double array.- Parameters:
- values- double array
 
 - 
BinaryCodedFieldpublic BinaryCodedField(java.lang.String[] strings) Construct a coded field from a String array.- Parameters:
- strings- String array
 
 
- 
 - 
Method Detail- 
getDataTypepublic byte getDataType() Get the data type associated with this field.- Returns:
- data type
 
 - 
getDoubleValuepublic double getDoubleValue() Get the double value contained with this field.- Returns:
- double value
- Throws:
- IllegalFieldAccessException- if data type is not DOUBLE.
 
 - 
getFloatValuepublic float getFloatValue() Get the float value contained with this field.- Returns:
- float value
- Throws:
- IllegalFieldAccessException- if data type is not FLOAT.
 
 - 
getByteArraypublic byte[] getByteArray() Get the byte array contained with this field.- Returns:
- byte array
- Throws:
- IllegalFieldAccessException- if data type is not BYTE_ARRAY.
 
 - 
getShortArraypublic short[] getShortArray() Get the short array contained with this field.- Returns:
- short array
- Throws:
- IllegalFieldAccessException- if data type is not SHORT_ARRAY.
 
 - 
getIntArraypublic int[] getIntArray() Get the int array contained with this field.- Returns:
- int array
- Throws:
- IllegalFieldAccessException- if data type is not INT_ARRAY.
 
 - 
getLongArraypublic long[] getLongArray() Get the long array contained with this field.- Returns:
- long array
- Throws:
- IllegalFieldAccessException- if data type is not LONG_ARRAY.
 
 - 
getFloatArraypublic float[] getFloatArray() Get the float array contained with this field.- Returns:
- float array
- Throws:
- IllegalFieldAccessException- if data type is not FLOAT_ARRAY.
 
 - 
getDoubleArraypublic double[] getDoubleArray() Get the double array contained with this field.- Returns:
- double array
- Throws:
- IllegalFieldAccessException- if data type is not DOUBLE_ARRAY.
 
 - 
getStringArraypublic java.lang.String[] getStringArray() Get the String array contained with this field.- Returns:
- String array
- Throws:
- IllegalFieldAccessException- if data type is not STRING_ARRAY.
 
 
- 
 
-