/**
 * This class is automatically generated by mig. DO NOT EDIT THIS FILE.
 * This class implements a Java interface to the 'QueryResultMsg'
 * message type.
 */

package net.tinyos.tinydb;

public class QueryResultMsg extends net.tinyos.message.Message {

    /** The default size of this message type in bytes. */
    public static final int DEFAULT_MESSAGE_SIZE = 42;

    /** The Active Message type associated with this message. */
    public static final int AM_TYPE = 240;

    /** Create a new QueryResultMsg of size 42. */
    public QueryResultMsg() {
        super(DEFAULT_MESSAGE_SIZE);
        amTypeSet(AM_TYPE);
    }

    /** Create a new QueryResultMsg of the given data_length. */
    public QueryResultMsg(int data_length) {
        super(data_length);
        amTypeSet(AM_TYPE);
    }

    /**
     * Create a new QueryResultMsg with the given data_length
     * and base offset.
     */
    public QueryResultMsg(int data_length, int base_offset) {
        super(data_length, base_offset);
        amTypeSet(AM_TYPE);
    }

    /**
     * Create a new QueryResultMsg using the given byte array
     * as backing store.
     */
    public QueryResultMsg(byte[] data) {
        super(data);
        amTypeSet(AM_TYPE);
    }

    /**
     * Create a new QueryResultMsg using the given byte array
     * as backing store, with the given base offset.
     */
    public QueryResultMsg(byte[] data, int base_offset) {
        super(data, base_offset);
        amTypeSet(AM_TYPE);
    }

    /**
     * Create a new QueryResultMsg using the given byte array
     * as backing store, with the given base offset and data length.
     */
    public QueryResultMsg(byte[] data, int base_offset, int data_length) {
        super(data, base_offset, data_length);
        amTypeSet(AM_TYPE);
    }

    /**
     * Create a new QueryResultMsg embedded in the given message
     * at the given base offset.
     */
    public QueryResultMsg(net.tinyos.message.Message msg, int base_offset) {
        super(msg, base_offset, DEFAULT_MESSAGE_SIZE);
        amTypeSet(AM_TYPE);
    }

    /**
     * Create a new QueryResultMsg embedded in the given message
     * at the given base offset and length.
     */
    public QueryResultMsg(net.tinyos.message.Message msg, int base_offset, int data_length) {
        super(msg, base_offset, data_length);
        amTypeSet(AM_TYPE);
    }

    /**
    /* Return a String representation of this message. Includes the
     * message type name and the non-indexed field values.
     */
    public String toString() {
      String s = "Message <QueryResultMsg> \n";
      try {
        s += "  [qid=0x"+Long.toHexString(get_qid())+"]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      try {
        s += "  [result_idx=0x"+Long.toHexString(get_result_idx())+"]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      try {
        s += "  [epoch=0x"+Long.toHexString(get_epoch())+"]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      try {
        s += "  [qrType=0x"+Long.toHexString(get_qrType())+"]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      try {
        s += "  [timeSyncData=";
        for (int i = 0; i < 5; i++) {
          s += "0x"+Long.toHexString(getElement_timeSyncData(i) & 0xff)+" ";
        }
        s += "]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      try {
        s += "  [clockCount=0x"+Long.toHexString(get_clockCount())+"]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      try {
        s += "  [lastDiff=0x"+Long.toHexString(get_lastDiff())+"]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      try {
        s += "  [d.t.qid=0x"+Long.toHexString(get_d_t_qid())+"]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      try {
        s += "  [d.t.numFields=0x"+Long.toHexString(get_d_t_numFields())+"]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      try {
        s += "  [d.t.notNull=0x"+Long.toHexString(get_d_t_notNull())+"]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      try {
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      try {
        s += "  [d.data=";
        for (int i = 0; i < 28; i++) {
          s += "0x"+Long.toHexString(getElement_d_data(i) & 0xff)+" ";
        }
        s += "]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      try {
        s += "  [d.buf.group=";
        for (int i = 0; i < 4; i++) {
          s += "0x"+Long.toHexString(getElement_d_buf_group(i) & 0xff)+" ";
        }
        s += "]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      try {
        s += "  [d.buf.data=";
        for (int i = 0; i < 4; i++) {
          s += "0x"+Long.toHexString(getElement_d_buf_data(i) & 0xff)+" ";
        }
        s += "]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      return s;
    }

    // Message-type-specific access methods appear below.

    /////////////////////////////////////////////////////////
    // Accessor methods for field: qid
    //   Field type: short
    //   Offset (bits): 0
    //   Size (bits): 8
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'qid' is signed (false).
     */
    public static boolean isSigned_qid() {
        return false;
    }

    /**
     * Return whether the field 'qid' is an array (false).
     */
    public static boolean isArray_qid() {
        return false;
    }

    /**
     * Return the offset (in bytes) of the field 'qid'
     */
    public static int offset_qid() {
        return (0 / 8);
    }

    /**
     * Return the offset (in bits) of the field 'qid'
     */
    public static int offsetBits_qid() {
        return 0;
    }

    /**
     * Return the value (as a short) of the field 'qid'
     */
    public short get_qid() {
        return (short)getUIntElement(offsetBits_qid(), 8);
    }

    /**
     * Set the value of the field 'qid'
     */
    public void set_qid(short value) {
        setUIntElement(offsetBits_qid(), 8, value);
    }

    /**
     * Return the size, in bytes, of the field 'qid'
     */
    public static int size_qid() {
        return (8 / 8);
    }

    /**
     * Return the size, in bits, of the field 'qid'
     */
    public static int sizeBits_qid() {
        return 8;
    }

    /////////////////////////////////////////////////////////
    // Accessor methods for field: result_idx
    //   Field type: byte
    //   Offset (bits): 8
    //   Size (bits): 8
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'result_idx' is signed (false).
     */
    public static boolean isSigned_result_idx() {
        return false;
    }

    /**
     * Return whether the field 'result_idx' is an array (false).
     */
    public static boolean isArray_result_idx() {
        return false;
    }

    /**
     * Return the offset (in bytes) of the field 'result_idx'
     */
    public static int offset_result_idx() {
        return (8 / 8);
    }

    /**
     * Return the offset (in bits) of the field 'result_idx'
     */
    public static int offsetBits_result_idx() {
        return 8;
    }

    /**
     * Return the value (as a byte) of the field 'result_idx'
     */
    public byte get_result_idx() {
        return (byte)getSIntElement(offsetBits_result_idx(), 8);
    }

    /**
     * Set the value of the field 'result_idx'
     */
    public void set_result_idx(byte value) {
        setSIntElement(offsetBits_result_idx(), 8, value);
    }

    /**
     * Return the size, in bytes, of the field 'result_idx'
     */
    public static int size_result_idx() {
        return (8 / 8);
    }

    /**
     * Return the size, in bits, of the field 'result_idx'
     */
    public static int sizeBits_result_idx() {
        return 8;
    }

    /////////////////////////////////////////////////////////
    // Accessor methods for field: epoch
    //   Field type: int
    //   Offset (bits): 16
    //   Size (bits): 16
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'epoch' is signed (false).
     */
    public static boolean isSigned_epoch() {
        return false;
    }

    /**
     * Return whether the field 'epoch' is an array (false).
     */
    public static boolean isArray_epoch() {
        return false;
    }

    /**
     * Return the offset (in bytes) of the field 'epoch'
     */
    public static int offset_epoch() {
        return (16 / 8);
    }

    /**
     * Return the offset (in bits) of the field 'epoch'
     */
    public static int offsetBits_epoch() {
        return 16;
    }

    /**
     * Return the value (as a int) of the field 'epoch'
     */
    public int get_epoch() {
        return (int)getUIntElement(offsetBits_epoch(), 16);
    }

    /**
     * Set the value of the field 'epoch'
     */
    public void set_epoch(int value) {
        setUIntElement(offsetBits_epoch(), 16, value);
    }

    /**
     * Return the size, in bytes, of the field 'epoch'
     */
    public static int size_epoch() {
        return (16 / 8);
    }

    /**
     * Return the size, in bits, of the field 'epoch'
     */
    public static int sizeBits_epoch() {
        return 16;
    }

    /////////////////////////////////////////////////////////
    // Accessor methods for field: qrType
    //   Field type: short
    //   Offset (bits): 32
    //   Size (bits): 8
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'qrType' is signed (false).
     */
    public static boolean isSigned_qrType() {
        return false;
    }

    /**
     * Return whether the field 'qrType' is an array (false).
     */
    public static boolean isArray_qrType() {
        return false;
    }

    /**
     * Return the offset (in bytes) of the field 'qrType'
     */
    public static int offset_qrType() {
        return (32 / 8);
    }

    /**
     * Return the offset (in bits) of the field 'qrType'
     */
    public static int offsetBits_qrType() {
        return 32;
    }

    /**
     * Return the value (as a short) of the field 'qrType'
     */
    public short get_qrType() {
        return (short)getUIntElement(offsetBits_qrType(), 8);
    }

    /**
     * Set the value of the field 'qrType'
     */
    public void set_qrType(short value) {
        setUIntElement(offsetBits_qrType(), 8, value);
    }

    /**
     * Return the size, in bytes, of the field 'qrType'
     */
    public static int size_qrType() {
        return (8 / 8);
    }

    /**
     * Return the size, in bits, of the field 'qrType'
     */
    public static int sizeBits_qrType() {
        return 8;
    }

    /////////////////////////////////////////////////////////
    // Accessor methods for field: timeSyncData
    //   Field type: short[]
    //   Offset (bits): 40
    //   Size of each element (bits): 8
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'timeSyncData' is signed (false).
     */
    public static boolean isSigned_timeSyncData() {
        return false;
    }

    /**
     * Return whether the field 'timeSyncData' is an array (true).
     */
    public static boolean isArray_timeSyncData() {
        return true;
    }

    /**
     * Return the offset (in bytes) of the field 'timeSyncData'
     */
    public static int offset_timeSyncData(int index1) {
        int offset = 40;
        if (index1 < 0 || index1 >= 5) throw new ArrayIndexOutOfBoundsException();
        offset += 0 + index1 * 8;
        return (offset / 8);
    }

    /**
     * Return the offset (in bits) of the field 'timeSyncData'
     */
    public static int offsetBits_timeSyncData(int index1) {
        int offset = 40;
        if (index1 < 0 || index1 >= 5) throw new ArrayIndexOutOfBoundsException();
        offset += 0 + index1 * 8;
        return offset;
    }

    /**
     * Return the entire array 'timeSyncData' as a short[]
     */
    public short[] get_timeSyncData() {
        short[] tmp = new short[5];
        for (int index0 = 0; index0 < numElements_timeSyncData(0); index0++) {
            tmp[index0] = getElement_timeSyncData(index0);
        }
        return tmp;
    }

    /**
     * Set the contents of the array 'timeSyncData' from the given short[]
     */
    public void set_timeSyncData(short[] value) {
        for (int index0 = 0; index0 < value.length; index0++) {
            setElement_timeSyncData(index0, value[index0]);
        }
    }

    /**
     * Return an element (as a short) of the array 'timeSyncData'
     */
    public short getElement_timeSyncData(int index1) {
        return (short)getUIntElement(offsetBits_timeSyncData(index1), 8);
    }

    /**
     * Set an element of the array 'timeSyncData'
     */
    public void setElement_timeSyncData(int index1, short value) {
        setUIntElement(offsetBits_timeSyncData(index1), 8, value);
    }

    /**
     * Return the total size, in bytes, of the array 'timeSyncData'
     */
    public static int totalSize_timeSyncData() {
        return (40 / 8);
    }

    /**
     * Return the total size, in bits, of the array 'timeSyncData'
     */
    public static int totalSizeBits_timeSyncData() {
        return 40;
    }

    /**
     * Return the size, in bytes, of each element of the array 'timeSyncData'
     */
    public static int elementSize_timeSyncData() {
        return (8 / 8);
    }

    /**
     * Return the size, in bits, of each element of the array 'timeSyncData'
     */
    public static int elementSizeBits_timeSyncData() {
        return 8;
    }

    /**
     * Return the number of dimensions in the array 'timeSyncData'
     */
    public static int numDimensions_timeSyncData() {
        return 1;
    }

    /**
     * Return the number of elements in the array 'timeSyncData'
     */
    public static int numElements_timeSyncData() {
        return 5;
    }

    /**
     * Return the number of elements in the array 'timeSyncData'
     * for the given dimension.
     */
    public static int numElements_timeSyncData(int dimension) {
      int array_dims[] = { 5,  };
        if (dimension < 0 || dimension >= 1) throw new ArrayIndexOutOfBoundsException();
        if (array_dims[dimension] == 0) throw new IllegalArgumentException("Array dimension "+dimension+" has unknown size");
        return array_dims[dimension];
    }

    /**
     * Fill in the array 'timeSyncData' with a String
     */
    public void setString_timeSyncData(String s) { 
         int len = s.length();
         int i;
         for (i = 0; i < len; i++) {
             setElement_timeSyncData(i, (short)s.charAt(i));
         }
         setElement_timeSyncData(i, (short)0); //null terminate
    }

    /**
     * Read the array 'timeSyncData' as a String
     */
    public String getString_timeSyncData() { 
         char carr[] = new char[Math.min(net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH,5)];
         int i;
         for (i = 0; i < carr.length; i++) {
             if ((char)getElement_timeSyncData(i) == (char)0) break;
             carr[i] = (char)getElement_timeSyncData(i);
         }
         return new String(carr,0,i);
    }

    /////////////////////////////////////////////////////////
    // Accessor methods for field: clockCount
    //   Field type: short
    //   Offset (bits): 80
    //   Size (bits): 16
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'clockCount' is signed (false).
     */
    public static boolean isSigned_clockCount() {
        return false;
    }

    /**
     * Return whether the field 'clockCount' is an array (false).
     */
    public static boolean isArray_clockCount() {
        return false;
    }

    /**
     * Return the offset (in bytes) of the field 'clockCount'
     */
    public static int offset_clockCount() {
        return (80 / 8);
    }

    /**
     * Return the offset (in bits) of the field 'clockCount'
     */
    public static int offsetBits_clockCount() {
        return 80;
    }

    /**
     * Return the value (as a short) of the field 'clockCount'
     */
    public short get_clockCount() {
        return (short)getSIntElement(offsetBits_clockCount(), 16);
    }

    /**
     * Set the value of the field 'clockCount'
     */
    public void set_clockCount(short value) {
        setSIntElement(offsetBits_clockCount(), 16, value);
    }

    /**
     * Return the size, in bytes, of the field 'clockCount'
     */
    public static int size_clockCount() {
        return (16 / 8);
    }

    /**
     * Return the size, in bits, of the field 'clockCount'
     */
    public static int sizeBits_clockCount() {
        return 16;
    }

    /////////////////////////////////////////////////////////
    // Accessor methods for field: lastDiff
    //   Field type: short
    //   Offset (bits): 96
    //   Size (bits): 16
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'lastDiff' is signed (false).
     */
    public static boolean isSigned_lastDiff() {
        return false;
    }

    /**
     * Return whether the field 'lastDiff' is an array (false).
     */
    public static boolean isArray_lastDiff() {
        return false;
    }

    /**
     * Return the offset (in bytes) of the field 'lastDiff'
     */
    public static int offset_lastDiff() {
        return (96 / 8);
    }

    /**
     * Return the offset (in bits) of the field 'lastDiff'
     */
    public static int offsetBits_lastDiff() {
        return 96;
    }

    /**
     * Return the value (as a short) of the field 'lastDiff'
     */
    public short get_lastDiff() {
        return (short)getSIntElement(offsetBits_lastDiff(), 16);
    }

    /**
     * Set the value of the field 'lastDiff'
     */
    public void set_lastDiff(short value) {
        setSIntElement(offsetBits_lastDiff(), 16, value);
    }

    /**
     * Return the size, in bytes, of the field 'lastDiff'
     */
    public static int size_lastDiff() {
        return (16 / 8);
    }

    /**
     * Return the size, in bits, of the field 'lastDiff'
     */
    public static int sizeBits_lastDiff() {
        return 16;
    }

    /////////////////////////////////////////////////////////
    // Accessor methods for field: d.t.qid
    //   Field type: short
    //   Offset (bits): 112
    //   Size (bits): 8
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'd.t.qid' is signed (false).
     */
    public static boolean isSigned_d_t_qid() {
        return false;
    }

    /**
     * Return whether the field 'd.t.qid' is an array (false).
     */
    public static boolean isArray_d_t_qid() {
        return false;
    }

    /**
     * Return the offset (in bytes) of the field 'd.t.qid'
     */
    public static int offset_d_t_qid() {
        return (112 / 8);
    }

    /**
     * Return the offset (in bits) of the field 'd.t.qid'
     */
    public static int offsetBits_d_t_qid() {
        return 112;
    }

    /**
     * Return the value (as a short) of the field 'd.t.qid'
     */
    public short get_d_t_qid() {
        return (short)getUIntElement(offsetBits_d_t_qid(), 8);
    }

    /**
     * Set the value of the field 'd.t.qid'
     */
    public void set_d_t_qid(short value) {
        setUIntElement(offsetBits_d_t_qid(), 8, value);
    }

    /**
     * Return the size, in bytes, of the field 'd.t.qid'
     */
    public static int size_d_t_qid() {
        return (8 / 8);
    }

    /**
     * Return the size, in bits, of the field 'd.t.qid'
     */
    public static int sizeBits_d_t_qid() {
        return 8;
    }

    /////////////////////////////////////////////////////////
    // Accessor methods for field: d.t.numFields
    //   Field type: byte
    //   Offset (bits): 120
    //   Size (bits): 8
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'd.t.numFields' is signed (false).
     */
    public static boolean isSigned_d_t_numFields() {
        return false;
    }

    /**
     * Return whether the field 'd.t.numFields' is an array (false).
     */
    public static boolean isArray_d_t_numFields() {
        return false;
    }

    /**
     * Return the offset (in bytes) of the field 'd.t.numFields'
     */
    public static int offset_d_t_numFields() {
        return (120 / 8);
    }

    /**
     * Return the offset (in bits) of the field 'd.t.numFields'
     */
    public static int offsetBits_d_t_numFields() {
        return 120;
    }

    /**
     * Return the value (as a byte) of the field 'd.t.numFields'
     */
    public byte get_d_t_numFields() {
        return (byte)getSIntElement(offsetBits_d_t_numFields(), 8);
    }

    /**
     * Set the value of the field 'd.t.numFields'
     */
    public void set_d_t_numFields(byte value) {
        setSIntElement(offsetBits_d_t_numFields(), 8, value);
    }

    /**
     * Return the size, in bytes, of the field 'd.t.numFields'
     */
    public static int size_d_t_numFields() {
        return (8 / 8);
    }

    /**
     * Return the size, in bits, of the field 'd.t.numFields'
     */
    public static int sizeBits_d_t_numFields() {
        return 8;
    }

    /////////////////////////////////////////////////////////
    // Accessor methods for field: d.t.notNull
    //   Field type: int
    //   Offset (bits): 128
    //   Size (bits): 32
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'd.t.notNull' is signed (false).
     */
    public static boolean isSigned_d_t_notNull() {
        return false;
    }

    /**
     * Return whether the field 'd.t.notNull' is an array (false).
     */
    public static boolean isArray_d_t_notNull() {
        return false;
    }

    /**
     * Return the offset (in bytes) of the field 'd.t.notNull'
     */
    public static int offset_d_t_notNull() {
        return (128 / 8);
    }

    /**
     * Return the offset (in bits) of the field 'd.t.notNull'
     */
    public static int offsetBits_d_t_notNull() {
        return 128;
    }

    /**
     * Return the value (as a int) of the field 'd.t.notNull'
     */
    public int get_d_t_notNull() {
        return (int)getSIntElement(offsetBits_d_t_notNull(), 32);
    }

    /**
     * Set the value of the field 'd.t.notNull'
     */
    public void set_d_t_notNull(int value) {
        setSIntElement(offsetBits_d_t_notNull(), 32, value);
    }

    /**
     * Return the size, in bytes, of the field 'd.t.notNull'
     */
    public static int size_d_t_notNull() {
        return (32 / 8);
    }

    /**
     * Return the size, in bits, of the field 'd.t.notNull'
     */
    public static int sizeBits_d_t_notNull() {
        return 32;
    }

    /////////////////////////////////////////////////////////
    // Accessor methods for field: d.t.fields
    //   Field type: byte[]
    //   Offset (bits): 160
    //   Size of each element (bits): 8
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'd.t.fields' is signed (false).
     */
    public static boolean isSigned_d_t_fields() {
        return false;
    }

    /**
     * Return whether the field 'd.t.fields' is an array (true).
     */
    public static boolean isArray_d_t_fields() {
        return true;
    }

    /**
     * Return the offset (in bytes) of the field 'd.t.fields'
     */
    public static int offset_d_t_fields(int index1) {
        int offset = 160;
        if (index1 < 0) throw new ArrayIndexOutOfBoundsException();
        offset += 0 + index1 * 8;
        return (offset / 8);
    }

    /**
     * Return the offset (in bits) of the field 'd.t.fields'
     */
    public static int offsetBits_d_t_fields(int index1) {
        int offset = 160;
        if (index1 < 0) throw new ArrayIndexOutOfBoundsException();
        offset += 0 + index1 * 8;
        return offset;
    }

    /**
     * Return the entire array 'd.t.fields' as a byte[]
     */
    public byte[] get_d_t_fields() {
        throw new IllegalArgumentException("Cannot get field as array - unknown size");
    }

    /**
     * Set the contents of the array 'd.t.fields' from the given byte[]
     */
    public void set_d_t_fields(byte[] value) {
        for (int index0 = 0; index0 < value.length; index0++) {
            setElement_d_t_fields(index0, value[index0]);
        }
    }

    /**
     * Return an element (as a byte) of the array 'd.t.fields'
     */
    public byte getElement_d_t_fields(int index1) {
        return (byte)getSIntElement(offsetBits_d_t_fields(index1), 8);
    }

    /**
     * Set an element of the array 'd.t.fields'
     */
    public void setElement_d_t_fields(int index1, byte value) {
        setSIntElement(offsetBits_d_t_fields(index1), 8, value);
    }

    /**
     * Return the size, in bytes, of each element of the array 'd.t.fields'
     */
    public static int elementSize_d_t_fields() {
        return (8 / 8);
    }

    /**
     * Return the size, in bits, of each element of the array 'd.t.fields'
     */
    public static int elementSizeBits_d_t_fields() {
        return 8;
    }

    /**
     * Return the number of dimensions in the array 'd.t.fields'
     */
    public static int numDimensions_d_t_fields() {
        return 1;
    }

    /**
     * Return the number of elements in the array 'd.t.fields'
     * for the given dimension.
     */
    public static int numElements_d_t_fields(int dimension) {
      int array_dims[] = { 0,  };
        if (dimension < 0 || dimension >= 1) throw new ArrayIndexOutOfBoundsException();
        if (array_dims[dimension] == 0) throw new IllegalArgumentException("Array dimension "+dimension+" has unknown size");
        return array_dims[dimension];
    }

    /**
     * Fill in the array 'd.t.fields' with a String
     */
    public void setString_d_t_fields(String s) { 
         int len = s.length();
         int i;
         for (i = 0; i < len; i++) {
             setElement_d_t_fields(i, (byte)s.charAt(i));
         }
         setElement_d_t_fields(i, (byte)0); //null terminate
    }

    /**
     * Read the array 'd.t.fields' as a String
     */
    public String getString_d_t_fields() { 
         char carr[] = new char[net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH];
         int i;
         for (i = 0; i < carr.length; i++) {
             if ((char)getElement_d_t_fields(i) == (char)0) break;
             carr[i] = (char)getElement_d_t_fields(i);
         }
         return new String(carr,0,i);
    }

    /////////////////////////////////////////////////////////
    // Accessor methods for field: d.data
    //   Field type: byte[]
    //   Offset (bits): 112
    //   Size of each element (bits): 8
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'd.data' is signed (false).
     */
    public static boolean isSigned_d_data() {
        return false;
    }

    /**
     * Return whether the field 'd.data' is an array (true).
     */
    public static boolean isArray_d_data() {
        return true;
    }

    /**
     * Return the offset (in bytes) of the field 'd.data'
     */
    public static int offset_d_data(int index1) {
        int offset = 112;
        if (index1 < 0 || index1 >= 28) throw new ArrayIndexOutOfBoundsException();
        offset += 0 + index1 * 8;
        return (offset / 8);
    }

    /**
     * Return the offset (in bits) of the field 'd.data'
     */
    public static int offsetBits_d_data(int index1) {
        int offset = 112;
        if (index1 < 0 || index1 >= 28) throw new ArrayIndexOutOfBoundsException();
        offset += 0 + index1 * 8;
        return offset;
    }

    /**
     * Return the entire array 'd.data' as a byte[]
     */
    public byte[] get_d_data() {
        byte[] tmp = new byte[28];
        for (int index0 = 0; index0 < numElements_d_data(0); index0++) {
            tmp[index0] = getElement_d_data(index0);
        }
        return tmp;
    }

    /**
     * Set the contents of the array 'd.data' from the given byte[]
     */
    public void set_d_data(byte[] value) {
        for (int index0 = 0; index0 < value.length; index0++) {
            setElement_d_data(index0, value[index0]);
        }
    }

    /**
     * Return an element (as a byte) of the array 'd.data'
     */
    public byte getElement_d_data(int index1) {
        return (byte)getSIntElement(offsetBits_d_data(index1), 8);
    }

    /**
     * Set an element of the array 'd.data'
     */
    public void setElement_d_data(int index1, byte value) {
        setSIntElement(offsetBits_d_data(index1), 8, value);
    }

    /**
     * Return the total size, in bytes, of the array 'd.data'
     */
    public static int totalSize_d_data() {
        return (224 / 8);
    }

    /**
     * Return the total size, in bits, of the array 'd.data'
     */
    public static int totalSizeBits_d_data() {
        return 224;
    }

    /**
     * Return the size, in bytes, of each element of the array 'd.data'
     */
    public static int elementSize_d_data() {
        return (8 / 8);
    }

    /**
     * Return the size, in bits, of each element of the array 'd.data'
     */
    public static int elementSizeBits_d_data() {
        return 8;
    }

    /**
     * Return the number of dimensions in the array 'd.data'
     */
    public static int numDimensions_d_data() {
        return 1;
    }

    /**
     * Return the number of elements in the array 'd.data'
     */
    public static int numElements_d_data() {
        return 28;
    }

    /**
     * Return the number of elements in the array 'd.data'
     * for the given dimension.
     */
    public static int numElements_d_data(int dimension) {
      int array_dims[] = { 28,  };
        if (dimension < 0 || dimension >= 1) throw new ArrayIndexOutOfBoundsException();
        if (array_dims[dimension] == 0) throw new IllegalArgumentException("Array dimension "+dimension+" has unknown size");
        return array_dims[dimension];
    }

    /**
     * Fill in the array 'd.data' with a String
     */
    public void setString_d_data(String s) { 
         int len = s.length();
         int i;
         for (i = 0; i < len; i++) {
             setElement_d_data(i, (byte)s.charAt(i));
         }
         setElement_d_data(i, (byte)0); //null terminate
    }

    /**
     * Read the array 'd.data' as a String
     */
    public String getString_d_data() { 
         char carr[] = new char[Math.min(net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH,28)];
         int i;
         for (i = 0; i < carr.length; i++) {
             if ((char)getElement_d_data(i) == (char)0) break;
             carr[i] = (char)getElement_d_data(i);
         }
         return new String(carr,0,i);
    }

    /////////////////////////////////////////////////////////
    // Accessor methods for field: d.buf.group
    //   Field type: int[]
    //   Offset (bits): 0
    //   Size of each element (bits): 16
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'd.buf.group' is signed (false).
     */
    public static boolean isSigned_d_buf_group() {
        return false;
    }

    /**
     * Return whether the field 'd.buf.group' is an array (true).
     */
    public static boolean isArray_d_buf_group() {
        return true;
    }

    /**
     * Return the offset (in bytes) of the field 'd.buf.group'
     */
    public static int offset_d_buf_group(int index1) {
        int offset = 0;
        if (index1 < 0 || index1 >= 4) throw new ArrayIndexOutOfBoundsException();
        offset += 112 + index1 * 32;
        return (offset / 8);
    }

    /**
     * Return the offset (in bits) of the field 'd.buf.group'
     */
    public static int offsetBits_d_buf_group(int index1) {
        int offset = 0;
        if (index1 < 0 || index1 >= 4) throw new ArrayIndexOutOfBoundsException();
        offset += 112 + index1 * 32;
        return offset;
    }

    /**
     * Return the entire array 'd.buf.group' as a int[]
     */
    public int[] get_d_buf_group() {
        int[] tmp = new int[4];
        for (int index0 = 0; index0 < numElements_d_buf_group(0); index0++) {
            tmp[index0] = getElement_d_buf_group(index0);
        }
        return tmp;
    }

    /**
     * Set the contents of the array 'd.buf.group' from the given int[]
     */
    public void set_d_buf_group(int[] value) {
        for (int index0 = 0; index0 < value.length; index0++) {
            setElement_d_buf_group(index0, value[index0]);
        }
    }

    /**
     * Return an element (as a int) of the array 'd.buf.group'
     */
    public int getElement_d_buf_group(int index1) {
        return (int)getUIntElement(offsetBits_d_buf_group(index1), 16);
    }

    /**
     * Set an element of the array 'd.buf.group'
     */
    public void setElement_d_buf_group(int index1, int value) {
        setUIntElement(offsetBits_d_buf_group(index1), 16, value);
    }

    /**
     * Return the total size, in bytes, of the array 'd.buf.group'
     */
    public static int totalSize_d_buf_group() {
        return (128 / 8);
    }

    /**
     * Return the total size, in bits, of the array 'd.buf.group'
     */
    public static int totalSizeBits_d_buf_group() {
        return 128;
    }

    /**
     * Return the size, in bytes, of each element of the array 'd.buf.group'
     */
    public static int elementSize_d_buf_group() {
        return (16 / 8);
    }

    /**
     * Return the size, in bits, of each element of the array 'd.buf.group'
     */
    public static int elementSizeBits_d_buf_group() {
        return 16;
    }

    /**
     * Return the number of dimensions in the array 'd.buf.group'
     */
    public static int numDimensions_d_buf_group() {
        return 1;
    }

    /**
     * Return the number of elements in the array 'd.buf.group'
     */
    public static int numElements_d_buf_group() {
        return 4;
    }

    /**
     * Return the number of elements in the array 'd.buf.group'
     * for the given dimension.
     */
    public static int numElements_d_buf_group(int dimension) {
      int array_dims[] = { 4,  };
        if (dimension < 0 || dimension >= 1) throw new ArrayIndexOutOfBoundsException();
        if (array_dims[dimension] == 0) throw new IllegalArgumentException("Array dimension "+dimension+" has unknown size");
        return array_dims[dimension];
    }

    /////////////////////////////////////////////////////////
    // Accessor methods for field: d.buf.data
    //   Field type: int[]
    //   Offset (bits): 16
    //   Size of each element (bits): 16
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'd.buf.data' is signed (false).
     */
    public static boolean isSigned_d_buf_data() {
        return false;
    }

    /**
     * Return whether the field 'd.buf.data' is an array (true).
     */
    public static boolean isArray_d_buf_data() {
        return true;
    }

    /**
     * Return the offset (in bytes) of the field 'd.buf.data'
     */
    public static int offset_d_buf_data(int index1) {
        int offset = 16;
        if (index1 < 0 || index1 >= 4) throw new ArrayIndexOutOfBoundsException();
        offset += 112 + index1 * 32;
        return (offset / 8);
    }

    /**
     * Return the offset (in bits) of the field 'd.buf.data'
     */
    public static int offsetBits_d_buf_data(int index1) {
        int offset = 16;
        if (index1 < 0 || index1 >= 4) throw new ArrayIndexOutOfBoundsException();
        offset += 112 + index1 * 32;
        return offset;
    }

    /**
     * Return the entire array 'd.buf.data' as a int[]
     */
    public int[] get_d_buf_data() {
        int[] tmp = new int[4];
        for (int index0 = 0; index0 < numElements_d_buf_data(0); index0++) {
            tmp[index0] = getElement_d_buf_data(index0);
        }
        return tmp;
    }

    /**
     * Set the contents of the array 'd.buf.data' from the given int[]
     */
    public void set_d_buf_data(int[] value) {
        for (int index0 = 0; index0 < value.length; index0++) {
            setElement_d_buf_data(index0, value[index0]);
        }
    }

    /**
     * Return an element (as a int) of the array 'd.buf.data'
     */
    public int getElement_d_buf_data(int index1) {
        return (int)getUIntElement(offsetBits_d_buf_data(index1), 16);
    }

    /**
     * Set an element of the array 'd.buf.data'
     */
    public void setElement_d_buf_data(int index1, int value) {
        setUIntElement(offsetBits_d_buf_data(index1), 16, value);
    }

    /**
     * Return the total size, in bytes, of the array 'd.buf.data'
     */
    public static int totalSize_d_buf_data() {
        return (128 / 8);
    }

    /**
     * Return the total size, in bits, of the array 'd.buf.data'
     */
    public static int totalSizeBits_d_buf_data() {
        return 128;
    }

    /**
     * Return the size, in bytes, of each element of the array 'd.buf.data'
     */
    public static int elementSize_d_buf_data() {
        return (16 / 8);
    }

    /**
     * Return the size, in bits, of each element of the array 'd.buf.data'
     */
    public static int elementSizeBits_d_buf_data() {
        return 16;
    }

    /**
     * Return the number of dimensions in the array 'd.buf.data'
     */
    public static int numDimensions_d_buf_data() {
        return 1;
    }

    /**
     * Return the number of elements in the array 'd.buf.data'
     */
    public static int numElements_d_buf_data() {
        return 4;
    }

    /**
     * Return the number of elements in the array 'd.buf.data'
     * for the given dimension.
     */
    public static int numElements_d_buf_data(int dimension) {
      int array_dims[] = { 4,  };
        if (dimension < 0 || dimension >= 1) throw new ArrayIndexOutOfBoundsException();
        if (array_dims[dimension] == 0) throw new IllegalArgumentException("Array dimension "+dimension+" has unknown size");
        return array_dims[dimension];
    }

}
