📄 unboundedenv.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Thu Aug 22 02:03:58 EDT 2002 --><TITLE>Marine Biology Simulation: Class UnboundedEnv</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_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><!-- ======== START OF CLASS DATA ======== --><H2>Class UnboundedEnv</H2><PRE>java.lang.Object | +--<A HREF="SquareEnvironment.html">SquareEnvironment</A> | +--<B>UnboundedEnv</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="Environment.html">Environment</A></DD></DL><HR><DL><DT>public class <B>UnboundedEnv</B><DT>extends <A HREF="SquareEnvironment.html">SquareEnvironment</A></DL><P>AP® Computer Science Marine Biology Simulation:<br> The <code>UnboundedEnv</code> class models an unbounded, two-dimensional, grid-like environment containing locatable objects. For example, it could be an environment of fish for a marine biology simulation. <p> Modification History: - Created to support multiple environment representations: this class represents a second implementation of the <code>Environment</code> interface. <p> The <code>UnboundedEnv</code> class is copyright© 2002 College Entrance Examination Board (www.collegeboard.com).<P><DL><DT><B>Version: </B><DD>1 July 2002</DD><DT><B>See Also: </B><DD><A HREF="Locatable.html"><CODE>Locatable</CODE></A>, <A HREF="Location.html"><CODE>Location</CODE></A></DL><HR><P><!-- ======== INNER 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"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="UnboundedEnv.html#UnboundedEnv()">UnboundedEnv</A></B>()</CODE><BR> Constructs an empty UnboundedEnv object.</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></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="UnboundedEnv.html#add(Locatable)">add</A></B>(<A HREF="Locatable.html">Locatable</A> obj)</CODE><BR> Adds a new object to this environment at the location it specifies.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="Locatable.html">Locatable</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="UnboundedEnv.html#allObjects()">allObjects</A></B>()</CODE><BR> Returns all the objects in this environment.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected int</CODE></FONT></TD><TD><CODE><B><A HREF="UnboundedEnv.html#indexOf(Location)">indexOf</A></B>(<A HREF="Location.html">Location</A> loc)</CODE><BR> Get the index of the object at the specified location.</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="UnboundedEnv.html#isEmpty(Location)">isEmpty</A></B>(<A HREF="Location.html">Location</A> loc)</CODE><BR> Determines whether a specific location in this environment is empty.</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="UnboundedEnv.html#isValid(Location)">isValid</A></B>(<A HREF="Location.html">Location</A> loc)</CODE><BR> Verifies whether a location is valid in this environment.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="UnboundedEnv.html#numCols()">numCols</A></B>()</CODE><BR> Returns number of columns in this environment.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="UnboundedEnv.html#numObjects()">numObjects</A></B>()</CODE><BR> Returns the number of objects in this environment.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="UnboundedEnv.html#numRows()">numRows</A></B>()</CODE><BR> Returns number of rows in this environment.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="Locatable.html">Locatable</A></CODE></FONT></TD><TD><CODE><B><A HREF="UnboundedEnv.html#objectAt(Location)">objectAt</A></B>(<A HREF="Location.html">Location</A> loc)</CODE><BR> Returns the object at a specific location in this environment.</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="UnboundedEnv.html#recordMove(Locatable, Location)">recordMove</A></B>(<A HREF="Locatable.html">Locatable</A> obj, <A HREF="Location.html">Location</A> oldLoc)</CODE><BR> Updates this environment to reflect the fact that an object moved.</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="UnboundedEnv.html#remove(Locatable)">remove</A></B>(<A HREF="Locatable.html">Locatable</A> obj)</CODE><BR> Removes the object from this environment.</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="UnboundedEnv.html#toString()">toString</A></B>()</CODE><BR> Creates a single string representing all the objects in this environment (not necessarily in any particular order).</TD></TR></TABLE> <A NAME="methods_inherited_from_class_SquareEnvironment"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class <A HREF="SquareEnvironment.html">SquareEnvironment</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="SquareEnvironment.html#getDirection(Location, Location)">getDirection</A>, <A HREF="SquareEnvironment.html#getNeighbor(Location, Direction)">getNeighbor</A>, <A HREF="SquareEnvironment.html#neighborsOf(Location)">neighborsOf</A>, <A HREF="SquareEnvironment.html#numAdjacentNeighbors()">numAdjacentNeighbors</A>, <A HREF="SquareEnvironment.html#numCellSides()">numCellSides</A>, <A HREF="SquareEnvironment.html#randomDirection()">randomDirection</A></CODE></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">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -