📄 unboundedenv.html
字号:
<TD><B>Methods inherited from class java.lang.Object</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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><A NAME="UnboundedEnv()"><!-- --></A><H3>UnboundedEnv</H3><PRE>public <B>UnboundedEnv</B>()</PRE><DL><DD>Constructs an empty UnboundedEnv object.</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="numRows()"><!-- --></A><H3>numRows</H3><PRE>public int <B>numRows</B>()</PRE><DL><DD>Returns number of rows in this environment.<DD><DL><DT><B>Returns:</B><DD>the number of rows, or -1 if the environment is unbounded</DL></DD></DL><HR><A NAME="numCols()"><!-- --></A><H3>numCols</H3><PRE>public int <B>numCols</B>()</PRE><DL><DD>Returns number of columns in this environment.<DD><DL><DT><B>Returns:</B><DD>the number of columns, or -1 if the environment is unbounded</DL></DD></DL><HR><A NAME="isValid(Location)"><!-- --></A><H3>isValid</H3><PRE>public boolean <B>isValid</B>(<A HREF="Location.html">Location</A> loc)</PRE><DL><DD>Verifies whether a location is valid in this environment.<DD><DL><DT><B>Parameters:</B><DD><CODE>loc</CODE> - location to check<DT><B>Returns:</B><DD><code>true</code> if <code>loc</code> is valid; <code>false</code> otherwise</DL></DD></DL><HR><A NAME="numObjects()"><!-- --></A><H3>numObjects</H3><PRE>public int <B>numObjects</B>()</PRE><DL><DD>Returns the number of objects in this environment.<DD><DL><DT><B>Returns:</B><DD>the number of objects</DL></DD></DL><HR><A NAME="allObjects()"><!-- --></A><H3>allObjects</H3><PRE>public <A HREF="Locatable.html">Locatable</A>[] <B>allObjects</B>()</PRE><DL><DD>Returns all the objects in this environment.<DD><DL><DT><B>Returns:</B><DD>an array of all the environment objects</DL></DD></DL><HR><A NAME="isEmpty(Location)"><!-- --></A><H3>isEmpty</H3><PRE>public boolean <B>isEmpty</B>(<A HREF="Location.html">Location</A> loc)</PRE><DL><DD>Determines whether a specific location in this environment is empty.<DD><DL><DT><B>Parameters:</B><DD><CODE>loc</CODE> - the location to test<DT><B>Returns:</B><DD><code>true</code> if <code>loc</code> is a valid location in the context of this environment and is empty; <code>false</code> otherwise</DL></DD></DL><HR><A NAME="objectAt(Location)"><!-- --></A><H3>objectAt</H3><PRE>public <A HREF="Locatable.html">Locatable</A> <B>objectAt</B>(<A HREF="Location.html">Location</A> loc)</PRE><DL><DD>Returns the object at a specific location in this environment.<DD><DL><DT><B>Parameters:</B><DD><CODE>loc</CODE> - the location in which to look<DT><B>Returns:</B><DD>the object at location <code>loc</code>; <code>null</code> if <code>loc</code> is empty</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public java.lang.String <B>toString</B>()</PRE><DL><DD>Creates a single string representing all the objects in this environment (not necessarily in any particular order).<DD><DL><DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a string indicating all the objects in this environment</DL></DD></DL><HR><A NAME="add(Locatable)"><!-- --></A><H3>add</H3><PRE>public void <B>add</B>(<A HREF="Locatable.html">Locatable</A> obj)</PRE><DL><DD>Adds a new object to this environment at the location it specifies. (Precondition: <code>obj.location()</code> is a valid empty location.)<DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - the new object to be added<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the precondition is not met</DL></DD></DL><HR><A NAME="remove(Locatable)"><!-- --></A><H3>remove</H3><PRE>public void <B>remove</B>(<A HREF="Locatable.html">Locatable</A> obj)</PRE><DL><DD>Removes the object from this environment. (Precondition: <code>obj</code> is in this environment.)<DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - the object to be removed<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the precondition is not met</DL></DD></DL><HR><A NAME="recordMove(Locatable, Location)"><!-- --></A><H3>recordMove</H3><PRE>public void <B>recordMove</B>(<A HREF="Locatable.html">Locatable</A> obj, <A HREF="Location.html">Location</A> oldLoc)</PRE><DL><DD>Updates this environment to reflect the fact that an object moved. (Precondition: <code>obj.location()</code> is a valid location and there is no other object there. Postcondition: <code>obj</code> is at the appropriate location (<code>obj.location()</code>), and either <code>oldLoc</code> is equal to <code>obj.location()</code> (there was no movement) or <code>oldLoc</code> is empty.)<DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - the object that moved<DD><CODE>oldLoc</CODE> - the previous location of <code>obj</code><DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the precondition is not met</DL></DD></DL><HR><A NAME="indexOf(Location)"><!-- --></A><H3>indexOf</H3><PRE>protected int <B>indexOf</B>(<A HREF="Location.html">Location</A> loc)</PRE><DL><DD>Get the index of the object at the specified location.<DD><DL><DT><B>Parameters:</B><DD><CODE>loc</CODE> - the location in which to look<DT><B>Returns:</B><DD>the index of the object at location <code>loc</code> if there is one; -1 otherwise</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=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</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><b>AP® Computer Science Marine Biology Simulation</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="SquareEnvironment.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="UnboundedEnv.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | 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><i>Copyright© 2002 College Entrance Examination Board</i></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -