code: package cnr.rubicon.migFiles;
  /**
   * This class is automatically generated by mig. DO NOT EDIT THIS FILE.
   * This class implements a Java interface to the 'NetMsg'
   * message type.
   */
  
  public class NetMsg extends net.tinyos.message.Message {
  
      /** The default size of this message type in bytes. */
      public static final int DEFAULT_MESSAGE_SIZE = 114;
  
      /** The Active Message type associated with this message. */
      public static final int AM_TYPE = 28;
  
      /** Create a new NetMsg of size 114. */
      public NetMsg() {
          super(DEFAULT_MESSAGE_SIZE);
          amTypeSet(AM_TYPE);
      }
  
      /** Create a new NetMsg of the given data_length. */
      public NetMsg(int data_length) {
          super(data_length);
          amTypeSet(AM_TYPE);
      }
  
      /**
       * Create a new NetMsg with the given data_length
       * and base offset.
       */
      public NetMsg(int data_length, int base_offset) {
          super(data_length, base_offset);
          amTypeSet(AM_TYPE);
      }
  
      /**
       * Create a new NetMsg using the given byte array
       * as backing store.
       */
      public NetMsg(byte[] data) {
          super(data);
          amTypeSet(AM_TYPE);
      }
  
      /**
       * Create a new NetMsg using the given byte array
       * as backing store, with the given base offset.
       */
      public NetMsg(byte[] data, int base_offset) {
          super(data, base_offset);
          amTypeSet(AM_TYPE);
      }
  
      /**
       * Create a new NetMsg using the given byte array
       * as backing store, with the given base offset and data length.
       */
      public NetMsg(byte[] data, int base_offset, int data_length) {
          super(data, base_offset, data_length);
          amTypeSet(AM_TYPE);
      }
  
      /**
       * Create a new NetMsg embedded in the given message
       * at the given base offset.
       */
      public NetMsg(net.tinyos.message.Message msg, int base_offset) {
          super(msg, base_offset, DEFAULT_MESSAGE_SIZE);
          amTypeSet(AM_TYPE);
      }
  
      /**
       * Create a new NetMsg embedded in the given message
       * at the given base offset and length.
       */
      public NetMsg(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 <NetMsg> \n";
        try {
          s += "  [dest.pid=0x"+Long.toHexString(get_dest_pid())+"]\n";
        } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
        try {
          s += "  [dest.devid=0x"+Long.toHexString(get_dest_devid())+"]\n";
        } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
        try {
          s += "  [src.pid=0x"+Long.toHexString(get_src_pid())+"]\n";
        } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
        try {
          s += "  [src.devid=0x"+Long.toHexString(get_src_devid())+"]\n";
        } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
        try {
          s += "  [reliable=0x"+Long.toHexString(get_reliable())+"]\n";
        } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
        try {
          s += "  [seq_num=0x"+Long.toHexString(get_seq_num())+"]\n";
        } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
        try {
          s += "  [nbytes=0x"+Long.toHexString(get_nbytes())+"]\n";
        } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
        try {
          s += "  [payload=";
          for (int i = 0; i < 102; i++) {
            s += "0x"+Long.toHexString(getElement_payload(i) & 0xff)+" ";
          }
          s += "]\n";
        } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
        return s;
      }
  
      // Message-type-specific access methods appear below.
  
      /////////////////////////////////////////////////////////
      // Accessor methods for field: dest.pid
      //   Field type: int, signed
      //   Offset (bits): 0
      //   Size (bits): 16
      /////////////////////////////////////////////////////////
  
      /**
       * Return whether the field 'dest.pid' is signed (true).
       */
      public static boolean isSigned_dest_pid() {
          return true;
      }
  
      /**
       * Return whether the field 'dest.pid' is an array (false).
       */
      public static boolean isArray_dest_pid() {
          return false;
      }
  
      /**
       * Return the offset (in bytes) of the field 'dest.pid'
       */
      public static int offset_dest_pid() {
          return (0 / 8);
      }
  
      /**
       * Return the offset (in bits) of the field 'dest.pid'
       */
      public static int offsetBits_dest_pid() {
          return 0;
      }
  
      /**
       * Return the value (as a int) of the field 'dest.pid'
       */
      public int get_dest_pid() {
          return (int)getUIntBEElement(offsetBits_dest_pid(), 16);
      }
  
      /**
       * Set the value of the field 'dest.pid'
       */
      public void set_dest_pid(int value) {
          setUIntBEElement(offsetBits_dest_pid(), 16, value);
      }
  
      /**
       * Return the size, in bytes, of the field 'dest.pid'
       */
      public static int size_dest_pid() {
          return (16 / 8);
      }
  
      /**
       * Return the size, in bits, of the field 'dest.pid'
       */
      public static int sizeBits_dest_pid() {
          return 16;
      }
  
      /////////////////////////////////////////////////////////
      // Accessor methods for field: dest.devid
      //   Field type: int, signed
      //   Offset (bits): 16
      //   Size (bits): 16
      /////////////////////////////////////////////////////////
  
      /**
       * Return whether the field 'dest.devid' is signed (true).
       */
      public static boolean isSigned_dest_devid() {
          return true;
      }
  
      /**
       * Return whether the field 'dest.devid' is an array (false).
       */
      public static boolean isArray_dest_devid() {
          return false;
      }
  
      /**
       * Return the offset (in bytes) of the field 'dest.devid'
       */
      public static int offset_dest_devid() {
          return (16 / 8);
      }
  
      /**
       * Return the offset (in bits) of the field 'dest.devid'
       */
      public static int offsetBits_dest_devid() {
          return 16;
      }
  
      /**
       * Return the value (as a int) of the field 'dest.devid'
       */
      public int get_dest_devid() {
          return (int)getUIntBEElement(offsetBits_dest_devid(), 16);
      }
  
      /**
       * Set the value of the field 'dest.devid'
       */
      public void set_dest_devid(int value) {
          setUIntBEElement(offsetBits_dest_devid(), 16, value);
      }
  
      /**
       * Return the size, in bytes, of the field 'dest.devid'
       */
      public static int size_dest_devid() {
          return (16 / 8);
      }
  
      /**
       * Return the size, in bits, of the field 'dest.devid'
       */
      public static int sizeBits_dest_devid() {
          return 16;
      }
  
      /////////////////////////////////////////////////////////
      // Accessor methods for field: src.pid
      //   Field type: int, signed
      //   Offset (bits): 32
      //   Size (bits): 16
      /////////////////////////////////////////////////////////
  
      /**
       * Return whether the field 'src.pid' is signed (true).
       */
      public static boolean isSigned_src_pid() {
          return true;
      }
  
      /**
       * Return whether the field 'src.pid' is an array (false).
       */
      public static boolean isArray_src_pid() {
          return false;
      }
  
      /**
       * Return the offset (in bytes) of the field 'src.pid'
       */
      public static int offset_src_pid() {
          return (32 / 8);
      }
  
      /**
       * Return the offset (in bits) of the field 'src.pid'
       */
      public static int offsetBits_src_pid() {
          return 32;
      }
  
      /**
       * Return the value (as a int) of the field 'src.pid'
       */
      public int get_src_pid() {
          return (int)getUIntBEElement(offsetBits_src_pid(), 16);
      }
  
      /**
       * Set the value of the field 'src.pid'
       */
      public void set_src_pid(int value) {
          setUIntBEElement(offsetBits_src_pid(), 16, value);
      }
  
      /**
       * Return the size, in bytes, of the field 'src.pid'
       */
      public static int size_src_pid() {
          return (16 / 8);
      }
  
      /**
       * Return the size, in bits, of the field 'src.pid'
       */
      public static int sizeBits_src_pid() {
          return 16;
      }
  
      /////////////////////////////////////////////////////////
      // Accessor methods for field: src.devid
      //   Field type: int, signed
      //   Offset (bits): 48
      //   Size (bits): 16
      /////////////////////////////////////////////////////////
  
      /**
       * Return whether the field 'src.devid' is signed (true).
       */
      public static boolean isSigned_src_devid() {
          return true;
      }
  
      /**
       * Return whether the field 'src.devid' is an array (false).
       */
      public static boolean isArray_src_devid() {
          return false;
      }
  
      /**
       * Return the offset (in bytes) of the field 'src.devid'
       */
      public static int offset_src_devid() {
          return (48 / 8);
      }
  
      /**
       * Return the offset (in bits) of the field 'src.devid'
       */
      public static int offsetBits_src_devid() {
          return 48;
      }
  
      /**
       * Return the value (as a int) of the field 'src.devid'
       */
      public int get_src_devid() {
          return (int)getUIntBEElement(offsetBits_src_devid(), 16);
      }
  
      /**
       * Set the value of the field 'src.devid'
       */
      public void set_src_devid(int value) {
          setUIntBEElement(offsetBits_src_devid(), 16, value);
      }
  
      /**
       * Return the size, in bytes, of the field 'src.devid'
       */
      public static int size_src_devid() {
          return (16 / 8);
      }
  
      /**
       * Return the size, in bits, of the field 'src.devid'
       */
      public static int sizeBits_src_devid() {
          return 16;
      }
  
      /////////////////////////////////////////////////////////
      // Accessor methods for field: reliable
      //   Field type: byte, signed
      //   Offset (bits): 64
      //   Size (bits): 8
      /////////////////////////////////////////////////////////
  
      /**
       * Return whether the field 'reliable' is signed (true).
       */
      public static boolean isSigned_reliable() {
          return true;
      }
  
      /**
       * Return whether the field 'reliable' is an array (false).
       */
      public static boolean isArray_reliable() {
          return false;
      }
  
      /**
       * Return the offset (in bytes) of the field 'reliable'
       */
      public static int offset_reliable() {
          return (64 / 8);
      }
  
      /**
       * Return the offset (in bits) of the field 'reliable'
       */
      public static int offsetBits_reliable() {
          return 64;
      }
  
      /**
       * Return the value (as a byte) of the field 'reliable'
       */
      public byte get_reliable() {
          return (byte)getSIntBEElement(offsetBits_reliable(), 8);
      }
  
      /**
       * Set the value of the field 'reliable'
       */
      public void set_reliable(byte value) {
          setSIntBEElement(offsetBits_reliable(), 8, value);
      }
  
      /**
       * Return the size, in bytes, of the field 'reliable'
       */
      public static int size_reliable() {
          return (8 / 8);
      }
  
      /**
       * Return the size, in bits, of the field 'reliable'
       */
      public static int sizeBits_reliable() {
          return 8;
      }
  
      /////////////////////////////////////////////////////////
      // Accessor methods for field: seq_num
      //   Field type: int, signed
      //   Offset (bits): 72
      //   Size (bits): 16
      /////////////////////////////////////////////////////////
  
      /**
       * Return whether the field 'seq_num' is signed (true).
       */
      public static boolean isSigned_seq_num() {
          return true;
      }
  
      /**
       * Return whether the field 'seq_num' is an array (false).
       */
      public static boolean isArray_seq_num() {
          return false;
      }
  
      /**
       * Return the offset (in bytes) of the field 'seq_num'
       */
      public static int offset_seq_num() {
          return (72 / 8);
      }
  
      /**
       * Return the offset (in bits) of the field 'seq_num'
       */
      public static int offsetBits_seq_num() {
          return 72;
      }
  
      /**
       * Return the value (as a int) of the field 'seq_num'
       */
      public int get_seq_num() {
          return (int)getUIntBEElement(offsetBits_seq_num(), 16);
      }
  
      /**
       * Set the value of the field 'seq_num'
       */
      public void set_seq_num(int value) {
          setUIntBEElement(offsetBits_seq_num(), 16, value);
      }
  
      /**
       * Return the size, in bytes, of the field 'seq_num'
       */
      public static int size_seq_num() {
          return (16 / 8);
      }
  
      /**
       * Return the size, in bits, of the field 'seq_num'
       */
      public static int sizeBits_seq_num() {
          return 16;
      }
  
      /////////////////////////////////////////////////////////
      // Accessor methods for field: nbytes
      //   Field type: short, signed
      //   Offset (bits): 88
      //   Size (bits): 8
      /////////////////////////////////////////////////////////
  
      /**
       * Return whether the field 'nbytes' is signed (true).
       */
      public static boolean isSigned_nbytes() {
          return true;
      }
  
      /**
       * Return whether the field 'nbytes' is an array (false).
       */
      public static boolean isArray_nbytes() {
          return false;
      }
  
      /**
       * Return the offset (in bytes) of the field 'nbytes'
       */
      public static int offset_nbytes() {
          return (88 / 8);
      }
  
      /**
       * Return the offset (in bits) of the field 'nbytes'
       */
      public static int offsetBits_nbytes() {
          return 88;
      }
  
      /**
       * Return the value (as a short) of the field 'nbytes'
       */
      public short get_nbytes() {
          return (short)getUIntBEElement(offsetBits_nbytes(), 8);
      }
  
      /**
       * Set the value of the field 'nbytes'
       */
      public void set_nbytes(short value) {
          setUIntBEElement(offsetBits_nbytes(), 8, value);
      }
  
      /**
       * Return the size, in bytes, of the field 'nbytes'
       */
      public static int size_nbytes() {
          return (8 / 8);
      }
  
      /**
       * Return the size, in bits, of the field 'nbytes'
       */
      public static int sizeBits_nbytes() {
          return 8;
      }
  
      /////////////////////////////////////////////////////////
      // Accessor methods for field: payload
      //   Field type: byte[], signed
      //   Offset (bits): 96
      //   Size of each element (bits): 8
      /////////////////////////////////////////////////////////
  
      /**
       * Return whether the field 'payload' is signed (true).
       */
      public static boolean isSigned_payload() {
          return true;
      }
  
      /**
       * Return whether the field 'payload' is an array (true).
       */
      public static boolean isArray_payload() {
          return true;
      }
  
      /**
       * Return the offset (in bytes) of the field 'payload'
       */
      public static int offset_payload(int index1) {
          int offset = 96;
          if (index1 < 0 || index1 >= 102) throw new ArrayIndexOutOfBoundsException();
          offset += 0 + index1 * 8;
          return (offset / 8);
      }
  
      /**
       * Return the offset (in bits) of the field 'payload'
       */
      public static int offsetBits_payload(int index1) {
          int offset = 96;
          if (index1 < 0 || index1 >= 102) throw new ArrayIndexOutOfBoundsException();
          offset += 0 + index1 * 8;
          return offset;
      }
  
      /**
       * Return the entire array 'payload' as a byte[]
       */
      public byte[] get_payload() {
          byte[] tmp = new byte[102];
          for (int index0 = 0; index0 < numElements_payload(0); index0++) {
              tmp[index0] = getElement_payload(index0);
          }
          return tmp;
      }
  
      /**
       * Set the contents of the array 'payload' from the given byte[]
       */
      public void set_payload(byte[] value) {
          for (int index0 = 0; index0 < value.length; index0++) {
              setElement_payload(index0, value[index0]);
          }
      }
  
      /**
       * Return an element (as a byte) of the array 'payload'
       */
      public byte getElement_payload(int index1) {
          return (byte)getSIntBEElement(offsetBits_payload(index1), 8);
      }
  
      /**
       * Set an element of the array 'payload'
       */
      public void setElement_payload(int index1, byte value) {
          setSIntBEElement(offsetBits_payload(index1), 8, value);
      }
  
      /**
       * Return the total size, in bytes, of the array 'payload'
       */
      public static int totalSize_payload() {
          return (816 / 8);
      }
  
      /**
       * Return the total size, in bits, of the array 'payload'
       */
      public static int totalSizeBits_payload() {
          return 816;
      }
  
      /**
       * Return the size, in bytes, of each element of the array 'payload'
       */
      public static int elementSize_payload() {
          return (8 / 8);
      }
  
      /**
       * Return the size, in bits, of each element of the array 'payload'
       */
      public static int elementSizeBits_payload() {
          return 8;
      }
  
      /**
       * Return the number of dimensions in the array 'payload'
       */
      public static int numDimensions_payload() {
          return 1;
      }
  
      /**
       * Return the number of elements in the array 'payload'
       */
      public static int numElements_payload() {
          return 102;
      }
  
      /**
       * Return the number of elements in the array 'payload'
       * for the given dimension.
       */
      public static int numElements_payload(int dimension) {
        int array_dims[] = { 102,  };
          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 'payload' with a String
       */
      public void setString_payload(String s) { 
           int len = s.length();
           int i;
           for (i = 0; i < len; i++) {
               setElement_payload(i, (byte)s.charAt(i));
           }
           setElement_payload(i, (byte)0); //null terminate
      }
  
      /**
       * Read the array 'payload' as a String
       */
      public String getString_payload() { 
           char carr[] = new char[Math.min(net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH,102)];
           int i;
           for (i = 0; i < carr.length; i++) {
               if ((char)getElement_payload(i) == (char)0) break;
               carr[i] = (char)getElement_payload(i);
           }
           return new String(carr,0,i);
      }
  
  }
  