variableresolvecommand.java

来自「tinyos最新版」· Java 代码 · 共 255 行

JAVA
255
字号
/** * This class is automatically generated by mig. DO NOT EDIT THIS FILE. * This class implements a Java interface to the 'VariableResolveCommand' * message type. */package net.tinyos.sim.msg;public class VariableResolveCommand extends net.tinyos.message.Message {    /** The default size of this message type in bytes. */    public static final int DEFAULT_MESSAGE_SIZE = 256;    /** The Active Message type associated with this message. */    public static final int AM_TYPE = 4105;    /** Create a new VariableResolveCommand of size 256. */    public VariableResolveCommand() {        super(DEFAULT_MESSAGE_SIZE);        amTypeSet(AM_TYPE);    }    /** Create a new VariableResolveCommand of the given data_length. */    public VariableResolveCommand(int data_length) {        super(data_length);        amTypeSet(AM_TYPE);    }    /**     * Create a new VariableResolveCommand with the given data_length     * and base offset.     */    public VariableResolveCommand(int data_length, int base_offset) {        super(data_length, base_offset);        amTypeSet(AM_TYPE);    }    /**     * Create a new VariableResolveCommand using the given byte array     * as backing store.     */    public VariableResolveCommand(byte[] data) {        super(data);        amTypeSet(AM_TYPE);    }    /**     * Create a new VariableResolveCommand using the given byte array     * as backing store, with the given base offset.     */    public VariableResolveCommand(byte[] data, int base_offset) {        super(data, base_offset);        amTypeSet(AM_TYPE);    }    /**     * Create a new VariableResolveCommand using the given byte array     * as backing store, with the given base offset and data length.     */    public VariableResolveCommand(byte[] data, int base_offset, int data_length) {        super(data, base_offset, data_length);        amTypeSet(AM_TYPE);    }    /**     * Create a new VariableResolveCommand embedded in the given message     * at the given base offset.     */    public VariableResolveCommand(net.tinyos.message.Message msg, int base_offset) {        super(msg, base_offset, DEFAULT_MESSAGE_SIZE);        amTypeSet(AM_TYPE);    }    /**     * Create a new VariableResolveCommand embedded in the given message     * at the given base offset and length.     */    public VariableResolveCommand(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 <VariableResolveCommand> \n";      try {        s += "  [name=";        for (int i = 0; i < 256; i++) {          s += "0x"+Long.toHexString(getElement_name(i) & 0xff)+" ";        }        s += "]\n";      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }      return s;    }    // Message-type-specific access methods appear below.    /////////////////////////////////////////////////////////    // Accessor methods for field: name    //   Field type: byte[], signed    //   Offset (bits): 0    //   Size of each element (bits): 8    /////////////////////////////////////////////////////////    /**     * Return whether the field 'name' is signed (true).     */    public static boolean isSigned_name() {        return true;    }    /**     * Return whether the field 'name' is an array (true).     */    public static boolean isArray_name() {        return true;    }    /**     * Return the offset (in bytes) of the field 'name'     */    public static int offset_name(int index1) {        int offset = 0;        if (index1 < 0 || index1 >= 256) throw new ArrayIndexOutOfBoundsException();        offset += 0 + index1 * 8;        return (offset / 8);    }    /**     * Return the offset (in bits) of the field 'name'     */    public static int offsetBits_name(int index1) {        int offset = 0;        if (index1 < 0 || index1 >= 256) throw new ArrayIndexOutOfBoundsException();        offset += 0 + index1 * 8;        return offset;    }    /**     * Return the entire array 'name' as a byte[]     */    public byte[] get_name() {        byte[] tmp = new byte[256];        for (int index0 = 0; index0 < numElements_name(0); index0++) {            tmp[index0] = getElement_name(index0);        }        return tmp;    }    /**     * Set the contents of the array 'name' from the given byte[]     */    public void set_name(byte[] value) {        for (int index0 = 0; index0 < value.length; index0++) {            setElement_name(index0, value[index0]);        }    }    /**     * Return an element (as a byte) of the array 'name'     */    public byte getElement_name(int index1) {        return (byte)getSIntElement(offsetBits_name(index1), 8);    }    /**     * Set an element of the array 'name'     */    public void setElement_name(int index1, byte value) {        setSIntElement(offsetBits_name(index1), 8, value);    }    /**     * Return the total size, in bytes, of the array 'name'     */    public static int totalSize_name() {        return (2048 / 8);    }    /**     * Return the total size, in bits, of the array 'name'     */    public static int totalSizeBits_name() {        return 2048;    }    /**     * Return the size, in bytes, of each element of the array 'name'     */    public static int elementSize_name() {        return (8 / 8);    }    /**     * Return the size, in bits, of each element of the array 'name'     */    public static int elementSizeBits_name() {        return 8;    }    /**     * Return the number of dimensions in the array 'name'     */    public static int numDimensions_name() {        return 1;    }    /**     * Return the number of elements in the array 'name'     */    public static int numElements_name() {        return 256;    }    /**     * Return the number of elements in the array 'name'     * for the given dimension.     */    public static int numElements_name(int dimension) {      int array_dims[] = { 256,  };        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 'name' with a String     */    public void setString_name(String s) {          int len = s.length();         int i;         for (i = 0; i < len; i++) {             setElement_name(i, (byte)s.charAt(i));         }         setElement_name(i, (byte)0); //null terminate    }    /**     * Read the array 'name' as a String     */    public String getString_name() {          char carr[] = new char[Math.min(net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH,256)];         int i;         for (i = 0; i < carr.length; i++) {             if ((char)getElement_name(i) == (char)0) break;             carr[i] = (char)getElement_name(i);         }         return new String(carr,0,i);    }}

⌨️ 快捷键说明

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