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

📄 intmsg.java

📁 用于传感器网络的节点操作系统 TinyOS 结构设计非常有意思
💻 JAVA
字号:
/** * This class is automatically generated by mig. DO NOT EDIT THIS FILE. * This class implements a Java interface to the 'IntMsg' * message type. */package net.tinyos.sim;public class IntMsg extends net.tinyos.message.Message {    /** The default size of this message type in bytes. */    public static final int DEFAULT_MESSAGE_SIZE = 3;    /** The Active Message type associated with this message. */    public static final int AM_TYPE = 4;    /** Create a new IntMsg of size 3. */    public IntMsg() {        super(DEFAULT_MESSAGE_SIZE);    }    /** Create a new IntMsg of the given data_length. */    public IntMsg(int data_length) {        super(data_length);    }    /**     * Create a new IntMsg with the given data_length     * and base offset.     */    public IntMsg(int data_length, int base_offset) {        super(data_length, base_offset);    }    /**     * Create a new IntMsg using the given byte array     * as backing store.     */    public IntMsg(byte[] data) {        super(data);    }    /**     * Create a new IntMsg using the given byte array     * as backing store, with the given base offset.     */    public IntMsg(byte[] data, int base_offset) {        super(data, base_offset);    }    /**     * Create a new IntMsg using the given byte array     * as backing store, with the given base offset and data length.     */    public IntMsg(byte[] data, int base_offset, int data_length) {        super(data, base_offset, data_length);    }    /**     * Create a new IntMsg embedded in the given message     * at the given base offset.     */    public IntMsg(net.tinyos.message.Message msg, int base_offset) {        super(msg, base_offset, DEFAULT_MESSAGE_SIZE);    }    /**     * Create a new IntMsg embedded in the given message     * at the given base offset and length.     */    public IntMsg(net.tinyos.message.Message msg, int base_offset, int data_length) {        super(msg, base_offset, data_length);    }    /** Return the Active Message type of this message (-1 if unknown). */    public int amType() {        return 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 <IntMsg> \n";      s += "  [val=0x"+Long.toHexString(get_val())+"]\n";      s += "  [src=0x"+Long.toHexString(get_src())+"]\n";      return s;    }    // Message-type-specific access methods appear below.    /////////////////////////////////////////////////////////    // Accessor methods for field: val    //   Field type: short, signed    //   Offset (bits): 0    //   Size (bits): 8    /////////////////////////////////////////////////////////    /**     * Return whether the field 'val' is signed (true).     */    public static boolean isSigned_val() {        return true;    }    /**     * Return whether the field 'val' is an array (false).     */    public static boolean isArray_val() {        return false;    }    /**     * Return the offset (in bytes) of the field 'val'     */    public static int offset_val() {        return (0 / 8);    }    /**     * Return the offset (in bits) of the field 'val'     */    public static int offsetBits_val() {        return 0;    }    /**     * Return the value (as a short) of the field 'val'     */    public short get_val() {        return (short)getSIntElement(offsetBits_val(), 8);    }    /**     * Set the value of the field 'val'     */    public void set_val(short value) {        setSIntElement(offsetBits_val(), 8, value);    }    /**     * Return the size, in bytes, of the field 'val'     */    public static int size_val() {        return (8 / 8);    }    /**     * Return the size, in bits, of the field 'val'     */    public static int sizeBits_val() {        return 8;    }    /////////////////////////////////////////////////////////    // Accessor methods for field: src    //   Field type: int, signed    //   Offset (bits): 8    //   Size (bits): 16    /////////////////////////////////////////////////////////    /**     * Return whether the field 'src' is signed (true).     */    public static boolean isSigned_src() {        return true;    }    /**     * Return whether the field 'src' is an array (false).     */    public static boolean isArray_src() {        return false;    }    /**     * Return the offset (in bytes) of the field 'src'     */    public static int offset_src() {        return (8 / 8);    }    /**     * Return the offset (in bits) of the field 'src'     */    public static int offsetBits_src() {        return 8;    }    /**     * Return the value (as a int) of the field 'src'     */    public int get_src() {        return (int)getSIntElement(offsetBits_src(), 16);    }    /**     * Set the value of the field 'src'     */    public void set_src(int value) {        setSIntElement(offsetBits_src(), 16, value);    }    /**     * Return the size, in bytes, of the field 'src'     */    public static int size_src() {        return (16 / 8);    }    /**     * Return the size, in bits, of the field 'src'     */    public static int sizeBits_src() {        return 16;    }}

⌨️ 快捷键说明

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