📄 setidmsg.java
字号:
/** * This class is automatically generated by mig. DO NOT EDIT THIS FILE. * This class implements a Java interface to the 'SetIdMsg' * message type. */package net.tinyos.ident;public class SetIdMsg extends net.tinyos.message.Message { /** The default size of this message type in bytes. */ public static final int DEFAULT_MESSAGE_SIZE = 15; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 11; /** Create a new SetIdMsg of size 15. */ public SetIdMsg() { super(DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** Create a new SetIdMsg of the given data_length. */ public SetIdMsg(int data_length) { super(data_length); amTypeSet(AM_TYPE); } /** * Create a new SetIdMsg with the given data_length * and base offset. */ public SetIdMsg(int data_length, int base_offset) { super(data_length, base_offset); amTypeSet(AM_TYPE); } /** * Create a new SetIdMsg using the given byte array * as backing store. */ public SetIdMsg(byte[] data) { super(data); amTypeSet(AM_TYPE); } /** * Create a new SetIdMsg using the given byte array * as backing store, with the given base offset. */ public SetIdMsg(byte[] data, int base_offset) { super(data, base_offset); amTypeSet(AM_TYPE); } /** * Create a new SetIdMsg using the given byte array * as backing store, with the given base offset and data length. */ public SetIdMsg(byte[] data, int base_offset, int data_length) { super(data, base_offset, data_length); amTypeSet(AM_TYPE); } /** * Create a new SetIdMsg embedded in the given message * at the given base offset. */ public SetIdMsg(net.tinyos.message.Message msg, int base_offset) { super(msg, base_offset, DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** * Create a new SetIdMsg embedded in the given message * at the given base offset and length. */ public SetIdMsg(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 <SetIdMsg> \n"; try { s += " [id.id="; for (int i = 0; i < 15; i++) { s += "0x"+Long.toHexString(getElement_id_id(i) & 0xff)+" "; } s += "]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } return s; } // Message-type-specific access methods appear below. ///////////////////////////////////////////////////////// // Accessor methods for field: id.id // Field type: byte[] // Offset (bits): 0 // Size of each element (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'id.id' is signed (false). */ public static boolean isSigned_id_id() { return false; } /** * Return whether the field 'id.id' is an array (true). */ public static boolean isArray_id_id() { return true; } /** * Return the offset (in bytes) of the field 'id.id' */ public static int offset_id_id(int index1) { int offset = 0; if (index1 < 0 || index1 >= 15) throw new ArrayIndexOutOfBoundsException(); offset += 0 + index1 * 8; return (offset / 8); } /** * Return the offset (in bits) of the field 'id.id' */ public static int offsetBits_id_id(int index1) { int offset = 0; if (index1 < 0 || index1 >= 15) throw new ArrayIndexOutOfBoundsException(); offset += 0 + index1 * 8; return offset; } /** * Return the entire array 'id.id' as a byte[] */ public byte[] get_id_id() { byte[] tmp = new byte[15]; for (int index0 = 0; index0 < numElements_id_id(0); index0++) { tmp[index0] = getElement_id_id(index0); } return tmp; } /** * Set the contents of the array 'id.id' from the given byte[] */ public void set_id_id(byte[] value) { for (int index0 = 0; index0 < value.length; index0++) { setElement_id_id(index0, value[index0]); } } /** * Return an element (as a byte) of the array 'id.id' */ public byte getElement_id_id(int index1) { return (byte)getSIntElement(offsetBits_id_id(index1), 8); } /** * Set an element of the array 'id.id' */ public void setElement_id_id(int index1, byte value) { setSIntElement(offsetBits_id_id(index1), 8, value); } /** * Return the total size, in bytes, of the array 'id.id' */ public static int totalSize_id_id() { return (120 / 8); } /** * Return the total size, in bits, of the array 'id.id' */ public static int totalSizeBits_id_id() { return 120; } /** * Return the size, in bytes, of each element of the array 'id.id' */ public static int elementSize_id_id() { return (8 / 8); } /** * Return the size, in bits, of each element of the array 'id.id' */ public static int elementSizeBits_id_id() { return 8; } /** * Return the number of dimensions in the array 'id.id' */ public static int numDimensions_id_id() { return 1; } /** * Return the number of elements in the array 'id.id' */ public static int numElements_id_id() { return 15; } /** * Return the number of elements in the array 'id.id' * for the given dimension. */ public static int numElements_id_id(int dimension) { int array_dims[] = { 15, }; 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 'id.id' with a String */ public void setString_id_id(String s) { int len = s.length(); int i; for (i = 0; i < len; i++) { setElement_id_id(i, (byte)s.charAt(i)); } setElement_id_id(i, (byte)0); //null terminate } /** * Read the array 'id.id' as a String */ public String getString_id_id() { char carr[] = new char[Math.min(net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH,15)]; int i; for (i = 0; i < carr.length; i++) { if ((char)getElement_id_id(i) == (char)0) break; carr[i] = (char)getElement_id_id(i); } return new String(carr,0,i); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -