📄 simobject.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Thu Jun 10 14:06:25 PDT 2004 --><TITLE>SimObject</TITLE><META NAME="keywords" CONTENT="net.tinyos.sim.script.reflect.SimObject,SimObject class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"></HEAD><SCRIPT>function asd(){parent.document.title="SimObject";}</SCRIPT><BODY BGCOLOR="white" onload="asd();"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_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><A NAME="main"></A><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">net.tinyos.sim.script.reflect</FONT><BR>Class SimObject</H2><PRE>java.lang.Object | +--net.tinyos.sim.script.reflect.SimReflect | +--<B>net.tinyos.sim.script.reflect.SimObject</B></PRE><DL><DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../net/tinyos/sim/script/reflect/Mote.html">Mote</A></DD></DL><HR><DL><DT>public class <B>SimObject</B><DT>extends net.tinyos.sim.script.reflect.SimReflect</DL><P>The SimObject class provides internal access to simulator objects that are not motes.<p> New objects are obtained by calling the newSimObject() method on the <A HREF="../../../../../net/tinyos/sim/script/reflect/Sim.html"><CODE>Sim</CODE></A> class.<P><P><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../../net/tinyos/sim/script/reflect/SimObject.html#SimObject(net.tinyos.sim.script.ScriptInterpreter, net.tinyos.sim.SimDriver, int, double, double)">SimObject</A></B>(net.tinyos.sim.script.ScriptInterpreter interp, net.tinyos.sim.SimDriver driver, int size, double x, double y)</CODE><BR> Constructor that's called by sim.newSimObject()</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../net/tinyos/sim/script/reflect/SimObject.html#addAttribute(java.lang.String, net.tinyos.sim.Attribute)">addAttribute</A></B>(java.lang.String name, net.tinyos.sim.Attribute attrib)</CODE><BR> Add the given attribute to the object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../net/tinyos/sim/script/reflect/SimObject.html#addAttributeChangedEvent(net.tinyos.sim.Attribute)">addAttributeChangedEvent</A></B>(net.tinyos.sim.Attribute attrib)</CODE><BR> Register an attribute changed event for the given attribute.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> net.tinyos.sim.Attribute</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../net/tinyos/sim/script/reflect/SimObject.html#getAttribute(java.lang.String)">getAttribute</A></B>(java.lang.String name)</CODE><BR> Return the attribute with the given name.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../net/tinyos/sim/script/reflect/SimObject.html#getCoord()">getCoord</A></B>()</CODE><BR> Return the object's coordinates as a string "(x, y)".</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../net/tinyos/sim/script/reflect/SimObject.html#getDistance(double, double)">getDistance</A></B>(double x, double y)</CODE><BR> Return the distance from this mote to the given coordinates</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../net/tinyos/sim/script/reflect/SimObject.html#getDistance(int)">getDistance</A></B>(int moteID)</CODE><BR> Return the distance from this mote to another.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../net/tinyos/sim/script/reflect/SimObject.html#getDistance(net.tinyos.sim.script.reflect.SimObject)">getDistance</A></B>(net.tinyos.sim.script.reflect.SimObject other)</CODE><BR> Return the distance from this mote to another.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../net/tinyos/sim/script/reflect/SimObject.html#getXCoord()">getXCoord</A></B>()</CODE><BR> Return the object's X coordinate.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../net/tinyos/sim/script/reflect/SimObject.html#getYCoord()">getYCoord</A></B>()</CODE><BR> Return the object's Y coordinate.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../net/tinyos/sim/script/reflect/SimObject.html#isSelected()">isSelected</A></B>()</CODE><BR> Determine if the object is selected.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../net/tinyos/sim/script/reflect/SimObject.html#move(double, double)">move</A></B>(double dx, double dy)</CODE><BR> Move the mote in virtual space by a given amount.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../net/tinyos/sim/script/reflect/SimObject.html#moveTo(double, double)">moveTo</A></B>(double x, double y)</CODE><BR> Move the mote in virtual space to the given location</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../net/tinyos/sim/script/reflect/SimObject.html#removeAttribute(java.lang.String)">removeAttribute</A></B>(java.lang.String name)</CODE><BR> Remove the given attribute from the object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../net/tinyos/sim/script/reflect/SimObject.html#setCoord(double, double)">setCoord</A></B>(double x, double y)</CODE><BR> Move the mote in virtual space to the given location. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../net/tinyos/sim/script/reflect/SimObject.html#setSelected()">setSelected</A></B>()</CODE><BR> Add the object to the selected set.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../net/tinyos/sim/script/reflect/SimObject.html#setUnselected()">setUnselected</A></B>()</CODE><BR> Remove the object from the selected set.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -