Package db

Class BinaryCodedField

All Implemented Interfaces:
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 Details

  • Constructor Details

    • BinaryCodedField

      public BinaryCodedField(BinaryField binField)
      Construct a coded field from an existing binary field.
      Parameters:
      binField - the binary field
    • BinaryCodedField

      public BinaryCodedField(double value)
      Construct a coded field from a double value.
      Parameters:
      value - the double value
    • BinaryCodedField

      public BinaryCodedField(float value)
      Construct a coded field from a float value.
      Parameters:
      value - the float value
    • BinaryCodedField

      public BinaryCodedField(byte[] values)
      Construct a coded field from a byte array.
      Parameters:
      values - byte array
    • BinaryCodedField

      public BinaryCodedField(short[] values)
      Construct a coded field from a short array.
      Parameters:
      values - short array
    • BinaryCodedField

      public BinaryCodedField(int[] values)
      Construct a coded field from a int array.
      Parameters:
      values - int array
    • BinaryCodedField

      public BinaryCodedField(long[] values)
      Construct a coded field from a long array.
      Parameters:
      values - long array
    • BinaryCodedField

      public BinaryCodedField(float[] values)
      Construct a coded field from a float array.
      Parameters:
      values - float array
    • BinaryCodedField

      public BinaryCodedField(double[] values)
      Construct a coded field from a double array.
      Parameters:
      values - double array
    • BinaryCodedField

      public BinaryCodedField(String[] strings)
      Construct a coded field from a String array.
      Parameters:
      strings - String array
  • Method Details

    • getDataType

      public byte getDataType()
      Get the data type associated with this field.
      Returns:
      data type
    • getDoubleValue

      public double getDoubleValue()
      Get the double value contained with this field.
      Returns:
      double value
      Throws:
      IllegalFieldAccessException - if data type is not DOUBLE.
    • getFloatValue

      public float getFloatValue()
      Get the float value contained with this field.
      Returns:
      float value
      Throws:
      IllegalFieldAccessException - if data type is not FLOAT.
    • getByteArray

      public byte[] getByteArray()
      Get the byte array contained with this field.
      Returns:
      byte array
      Throws:
      IllegalFieldAccessException - if data type is not BYTE_ARRAY.
    • getShortArray

      public short[] getShortArray()
      Get the short array contained with this field.
      Returns:
      short array
      Throws:
      IllegalFieldAccessException - if data type is not SHORT_ARRAY.
    • getIntArray

      public int[] getIntArray()
      Get the int array contained with this field.
      Returns:
      int array
      Throws:
      IllegalFieldAccessException - if data type is not INT_ARRAY.
    • getLongArray

      public long[] getLongArray()
      Get the long array contained with this field.
      Returns:
      long array
      Throws:
      IllegalFieldAccessException - if data type is not LONG_ARRAY.
    • getFloatArray

      public float[] getFloatArray()
      Get the float array contained with this field.
      Returns:
      float array
      Throws:
      IllegalFieldAccessException - if data type is not FLOAT_ARRAY.
    • getDoubleArray

      public double[] getDoubleArray()
      Get the double array contained with this field.
      Returns:
      double array
      Throws:
      IllegalFieldAccessException - if data type is not DOUBLE_ARRAY.
    • getStringArray

      public String[] getStringArray()
      Get the String array contained with this field.
      Returns:
      String array
      Throws:
      IllegalFieldAccessException - if data type is not STRING_ARRAY.