⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fieldmsg.java

📁 tinyos最新版
💻 JAVA
字号:
/** * This class is automatically generated by mig. DO NOT EDIT THIS FILE. * This class implements a Java interface to the 'FieldMsg' * message type. */package net.tinyos.task.awtfield;public class FieldMsg extends net.tinyos.message.Message {    /** The default size of this message type in bytes. */    public static final int DEFAULT_MESSAGE_SIZE = 4;    /** The Active Message type associated with this message. */    public static final int AM_TYPE = 121;    /** Create a new FieldMsg of size 4. */    public FieldMsg() {        super(DEFAULT_MESSAGE_SIZE);        amTypeSet(AM_TYPE);    }    /** Create a new FieldMsg of the given data_length. */    public FieldMsg(int data_length) {        super(data_length);        amTypeSet(AM_TYPE);    }    /**     * Create a new FieldMsg with the given data_length     * and base offset.     */    public FieldMsg(int data_length, int base_offset) {        super(data_length, base_offset);        amTypeSet(AM_TYPE);    }    /**     * Create a new FieldMsg using the given byte array     * as backing store.     */    public FieldMsg(byte[] data) {        super(data);        amTypeSet(AM_TYPE);    }    /**     * Create a new FieldMsg using the given byte array     * as backing store, with the given base offset.     */    public FieldMsg(byte[] data, int base_offset) {        super(data, base_offset);        amTypeSet(AM_TYPE);    }    /**     * Create a new FieldMsg using the given byte array     * as backing store, with the given base offset and data length.     */    public FieldMsg(byte[] data, int base_offset, int data_length) {        super(data, base_offset, data_length);        amTypeSet(AM_TYPE);    }    /**     * Create a new FieldMsg embedded in the given message     * at the given base offset.     */    public FieldMsg(net.tinyos.message.Message msg, int base_offset) {        super(msg, base_offset, DEFAULT_MESSAGE_SIZE);        amTypeSet(AM_TYPE);    }    /**     * Create a new FieldMsg embedded in the given message     * at the given base offset and length.     */    public FieldMsg(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 <FieldMsg> \n";      try {        s += "  [sender=0x"+Long.toHexString(get_sender())+"]\n";      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }      try {        s += "  [cmdId=0x"+Long.toHexString(get_cmdId())+"]\n";      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }      try {      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }      return s;    }    // Message-type-specific access methods appear below.    /////////////////////////////////////////////////////////    // Accessor methods for field: sender    //   Field type: int, signed    //   Offset (bits): 0    //   Size (bits): 16    /////////////////////////////////////////////////////////    /**     * Return whether the field 'sender' is signed (true).     */    public static boolean isSigned_sender() {        return true;    }    /**     * Return whether the field 'sender' is an array (false).     */    public static boolean isArray_sender() {        return false;    }    /**     * Return the offset (in bytes) of the field 'sender'     */    public static int offset_sender() {        return (0 / 8);    }    /**     * Return the offset (in bits) of the field 'sender'     */    public static int offsetBits_sender() {        return 0;    }    /**     * Return the value (as a int) of the field 'sender'     */    public int get_sender() {        return (int)getUIntElement(offsetBits_sender(), 16);    }    /**     * Set the value of the field 'sender'     */    public void set_sender(int value) {        setUIntElement(offsetBits_sender(), 16, value);    }    /**     * Return the size, in bytes, of the field 'sender'     */    public static int size_sender() {        return (16 / 8);    }    /**     * Return the size, in bits, of the field 'sender'     */    public static int sizeBits_sender() {        return 16;    }    /////////////////////////////////////////////////////////    // Accessor methods for field: cmdId    //   Field type: int, signed    //   Offset (bits): 16    //   Size (bits): 16    /////////////////////////////////////////////////////////    /**     * Return whether the field 'cmdId' is signed (true).     */    public static boolean isSigned_cmdId() {        return true;    }    /**     * Return whether the field 'cmdId' is an array (false).     */    public static boolean isArray_cmdId() {        return false;    }    /**     * Return the offset (in bytes) of the field 'cmdId'     */    public static int offset_cmdId() {        return (16 / 8);    }    /**     * Return the offset (in bits) of the field 'cmdId'     */    public static int offsetBits_cmdId() {        return 16;    }    /**     * Return the value (as a int) of the field 'cmdId'     */    public int get_cmdId() {        return (int)getUIntElement(offsetBits_cmdId(), 16);    }    /**     * Set the value of the field 'cmdId'     */    public void set_cmdId(int value) {        setUIntElement(offsetBits_cmdId(), 16, value);    }    /**     * Return the size, in bytes, of the field 'cmdId'     */    public static int size_cmdId() {        return (16 / 8);    }    /**     * Return the size, in bits, of the field 'cmdId'     */    public static int sizeBits_cmdId() {        return 16;    }    /////////////////////////////////////////////////////////    // Accessor methods for field: cmd    //   Field type: byte[], signed    //   Offset (bits): 32    //   Size of each element (bits): 8    /////////////////////////////////////////////////////////    /**     * Return whether the field 'cmd' is signed (true).     */    public static boolean isSigned_cmd() {        return true;    }    /**     * Return whether the field 'cmd' is an array (true).     */    public static boolean isArray_cmd() {        return true;    }    /**     * Return the offset (in bytes) of the field 'cmd'     */    public static int offset_cmd(int index1) {        int offset = 32;        if (index1 < 0) throw new ArrayIndexOutOfBoundsException();        offset += 0 + index1 * 8;        return (offset / 8);    }    /**     * Return the offset (in bits) of the field 'cmd'     */    public static int offsetBits_cmd(int index1) {        int offset = 32;        if (index1 < 0) throw new ArrayIndexOutOfBoundsException();        offset += 0 + index1 * 8;        return offset;    }    /**     * Return the entire array 'cmd' as a byte[]     */    public byte[] get_cmd() {        throw new IllegalArgumentException("Cannot get field as array - unknown size");    }    /**     * Set the contents of the array 'cmd' from the given byte[]     */    public void set_cmd(byte[] value) {        for (int index0 = 0; index0 < value.length; index0++) {            setElement_cmd(index0, value[index0]);        }    }    /**     * Return an element (as a byte) of the array 'cmd'     */    public byte getElement_cmd(int index1) {        return (byte)getSIntElement(offsetBits_cmd(index1), 8);    }    /**     * Set an element of the array 'cmd'     */    public void setElement_cmd(int index1, byte value) {        setSIntElement(offsetBits_cmd(index1), 8, value);    }    /**     * Return the size, in bytes, of each element of the array 'cmd'     */    public static int elementSize_cmd() {        return (8 / 8);    }    /**     * Return the size, in bits, of each element of the array 'cmd'     */    public static int elementSizeBits_cmd() {        return 8;    }    /**     * Return the number of dimensions in the array 'cmd'     */    public static int numDimensions_cmd() {        return 1;    }    /**     * Return the number of elements in the array 'cmd'     * for the given dimension.     */    public static int numElements_cmd(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 'cmd' with a String     */    public void setString_cmd(String s) {          int len = s.length();         int i;         for (i = 0; i < len; i++) {             setElement_cmd(i, (byte)s.charAt(i));         }         setElement_cmd(i, (byte)0); //null terminate    }    /**     * Read the array 'cmd' as a String     */    public String getString_cmd() {          char carr[] = new char[net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH];         int i;         for (i = 0; i < carr.length; i++) {             if ((char)getElement_cmd(i) == (char)0) break;             carr[i] = (char)getElement_cmd(i);         }         return new String(carr,0,i);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -