📄 simobject.html
字号:
<A NAME="SimObject(net.tinyos.sim.script.ScriptInterpreter, net.tinyos.sim.SimDriver, int, double, double)"><!-- --></A><H3>SimObject</H3><PRE>public <B>SimObject</B>(net.tinyos.sim.script.ScriptInterpreter interp, net.tinyos.sim.SimDriver driver, int size, double x, double y)</PRE><DL><DD>Constructor that's called by sim.newSimObject()<P></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="addAttribute(java.lang.String, net.tinyos.sim.Attribute)"><!-- --></A><H3>addAttribute</H3><PRE>public void <B>addAttribute</B>(java.lang.String name, net.tinyos.sim.Attribute attrib)</PRE><DL><DD>Add the given attribute to the object.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the attribute<DD><CODE>attrib</CODE> - the attribute</DL></DD></DL><HR><A NAME="getAttribute(java.lang.String)"><!-- --></A><H3>getAttribute</H3><PRE>public net.tinyos.sim.Attribute <B>getAttribute</B>(java.lang.String name)</PRE><DL><DD>Return the attribute with the given name.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the attribute<DT><B>Returns:</B><DD>the attribute</DL></DD></DL><HR><A NAME="removeAttribute(java.lang.String)"><!-- --></A><H3>removeAttribute</H3><PRE>public void <B>removeAttribute</B>(java.lang.String name)</PRE><DL><DD>Remove the given attribute from the object.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the attribute</DL></DD></DL><HR><A NAME="addAttributeChangedEvent(net.tinyos.sim.Attribute)"><!-- --></A><H3>addAttributeChangedEvent</H3><PRE>public void <B>addAttributeChangedEvent</B>(net.tinyos.sim.Attribute attrib)</PRE><DL><DD>Register an attribute changed event for the given attribute.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>attrib</CODE> - the attribute</DL></DD></DL><HR><A NAME="getCoord()"><!-- --></A><H3>getCoord</H3><PRE>public java.lang.String <B>getCoord</B>()</PRE><DL><DD>Return the object's coordinates as a string "(x, y)".<P><DD><DL></DL></DD></DL><HR><A NAME="getXCoord()"><!-- --></A><H3>getXCoord</H3><PRE>public double <B>getXCoord</B>()</PRE><DL><DD>Return the object's X coordinate.<P><DD><DL></DL></DD></DL><HR><A NAME="getYCoord()"><!-- --></A><H3>getYCoord</H3><PRE>public double <B>getYCoord</B>()</PRE><DL><DD>Return the object's Y coordinate.<P><DD><DL></DL></DD></DL><HR><A NAME="getDistance(net.tinyos.sim.script.reflect.SimObject)"><!-- --></A><H3>getDistance</H3><PRE>public double <B>getDistance</B>(net.tinyos.sim.script.reflect.SimObject other)</PRE><DL><DD>Return the distance from this mote to another.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>other</CODE> - the other Mote instance</DL></DD></DL><HR><A NAME="getDistance(int)"><!-- --></A><H3>getDistance</H3><PRE>public double <B>getDistance</B>(int moteID)</PRE><DL><DD>Return the distance from this mote to another.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>moteID</CODE> - the other Mote id</DL></DD></DL><HR><A NAME="getDistance(double, double)"><!-- --></A><H3>getDistance</H3><PRE>public double <B>getDistance</B>(double x, double y)</PRE><DL><DD>Return the distance from this mote to the given coordinates<P><DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the X coordinate of the target point<DD><CODE>y</CODE> - the Y coordinate of the target point</DL></DD></DL><HR><A NAME="move(double, double)"><!-- --></A><H3>move</H3><PRE>public void <B>move</B>(double dx, double dy)</PRE><DL><DD>Move the mote in virtual space by a given amount.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>dx</CODE> - distance to move in the X direction<DD><CODE>dy</CODE> - distance to move in the Y direction</DL></DD></DL><HR><A NAME="moveTo(double, double)"><!-- --></A><H3>moveTo</H3><PRE>public void <B>moveTo</B>(double x, double y)</PRE><DL><DD>Move the mote in virtual space to the given location<P><DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - new X coordinate<DD><CODE>y</CODE> - new Y coordinate</DL></DD></DL><HR><A NAME="setCoord(double, double)"><!-- --></A><H3>setCoord</H3><PRE>public void <B>setCoord</B>(double x, double y)</PRE><DL><DD>Move the mote in virtual space to the given location. Analogous to moveTo().<P><DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - new X coordinate<DD><CODE>y</CODE> - new Y coordinate</DL></DD></DL><HR><A NAME="isSelected()"><!-- --></A><H3>isSelected</H3><PRE>public boolean <B>isSelected</B>()</PRE><DL><DD>Determine if the object is selected.<P><DD><DL></DL></DD></DL><HR><A NAME="setSelected()"><!-- --></A><H3>setSelected</H3><PRE>public void <B>setSelected</B>()</PRE><DL><DD>Add the object to the selected set.<P><DD><DL></DL></DD></DL><HR><A NAME="setUnselected()"><!-- --></A><H3>setUnselected</H3><PRE>public void <B>setUnselected</B>()</PRE><DL><DD>Remove the object from the selected set.<P><DD><DL></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <A HREF="#main"><FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../serialized-form.html"><FONT CLASS="NavBarFont1"><B>Serialized</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../net/tinyos/sim/script/reflect/Sim.html"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="SimObject.html" TARGET="_top"><B>NO FRAMES</B></A> <SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT><A HREF="../../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -