⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 squareenvironment.html

📁 java学习的好范例
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!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:57 EDT 2002 --><TITLE>Marine Biology Simulation: Class  SquareEnvironment</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"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>AP&reg; Computer Science Marine Biology Simulation</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="SlowFish.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="UnboundedEnv.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="SquareEnvironment.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2>Class  SquareEnvironment</H2><PRE>java.lang.Object  |  +--<B>SquareEnvironment</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="Environment.html">Environment</A></DD></DL><DL><DT><B>Direct Known Subclasses:</B> <DD><A HREF="BoundedEnv.html">BoundedEnv</A>, <A HREF="UnboundedEnv.html">UnboundedEnv</A></DD></DL><HR><DL><DT>public abstract class <B>SquareEnvironment</B><DT>extends java.lang.Object<DT>implements <A HREF="Environment.html">Environment</A></DL><P>AP&reg; Computer Science Marine Biology Simulation:<br>  <code>SquareEnvironment</code> is an abstract class that implements  only the navigational methods in the <code>Environment</code> interface.  It considers the cells in the environment to be square, with sides  to the north, south, east, and west, and navigates accordingly.  <p>  The <code>SquareEnvironment</code> class is  copyright&copy; 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="Direction.html"><CODE>Direction</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="SquareEnvironment.html#SquareEnvironment()">SquareEnvironment</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a <code>SquareEnvironment</code> object in which cells  have four adjacent neighbors -- those with which they share sides.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="SquareEnvironment.html#SquareEnvironment(boolean)">SquareEnvironment</A></B>(boolean&nbsp;includeDiagonalNeighbors)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a <code>SquareEnvironment</code> object in which cells  have four or eight adjacent neighbors, depending on the value  of the <code>includeDiagonalNeighbors</code> parameter.</TD></TR></TABLE>&nbsp;<!-- ========== 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>&nbsp;<A HREF="Direction.html">Direction</A></CODE></FONT></TD><TD><CODE><B><A HREF="SquareEnvironment.html#getDirection(Location, Location)">getDirection</A></B>(<A HREF="Location.html">Location</A>&nbsp;fromLoc,             <A HREF="Location.html">Location</A>&nbsp;toLoc)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the direction from one location to another.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="Location.html">Location</A></CODE></FONT></TD><TD><CODE><B><A HREF="SquareEnvironment.html#getNeighbor(Location, Direction)">getNeighbor</A></B>(<A HREF="Location.html">Location</A>&nbsp;fromLoc,            <A HREF="Direction.html">Direction</A>&nbsp;compassDir)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the adjacent neighbor (whether valid or invalid) of a location  in the specified direction.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.util.ArrayList</CODE></FONT></TD><TD><CODE><B><A HREF="SquareEnvironment.html#neighborsOf(Location)">neighborsOf</A></B>(<A HREF="Location.html">Location</A>&nbsp;ofLoc)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the adjacent neighbors of a specified location.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="SquareEnvironment.html#numAdjacentNeighbors()">numAdjacentNeighbors</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of adjacent neighbors around each cell.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="SquareEnvironment.html#numCellSides()">numCellSides</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of sides around each cell.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="Direction.html">Direction</A></CODE></FONT></TD><TD><CODE><B><A HREF="SquareEnvironment.html#randomDirection()">randomDirection</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a random direction.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><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, toString, wait, wait, wait</CODE></TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_Environment"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from interface <A HREF="Environment.html">Environment</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="Environment.html#add(Locatable)">add</A>, <A HREF="Environment.html#allObjects()">allObjects</A>, <A HREF="Environment.html#isEmpty(Location)">isEmpty</A>, <A HREF="Environment.html#isValid(Location)">isValid</A>, <A HREF="Environment.html#numCols()">numCols</A>, <A HREF="Environment.html#numObjects()">numObjects</A>, <A HREF="Environment.html#numRows()">numRows</A>, <A HREF="Environment.html#objectAt(Location)">objectAt</A>, <A HREF="Environment.html#recordMove(Locatable, Location)">recordMove</A>, <A HREF="Environment.html#remove(Locatable)">remove</A></CODE></TD>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -