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

📄 slowfish.html

📁 java学习的好范例
💻 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:57 EDT 2002 --><TITLE>Marine Biology Simulation: Class  SlowFish</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="Simulation.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="SquareEnvironment.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="SlowFish.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  SlowFish</H2><PRE>java.lang.Object  |  +--<A HREF="Fish.html">Fish</A>        |        +--<B>SlowFish</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="Locatable.html">Locatable</A></DD></DL><HR><DL><DT>public class <B>SlowFish</B><DT>extends <A HREF="Fish.html">Fish</A></DL><P>AP&reg; Computer Science Marine Biology Simulation:<br>  The <code>SlowFish</code> class represents a fish in the Marine Biology  Simulation that moves very slowly.  It moves so slowly that it only has  a 1 in 5 chance of moving out of its current cell into an adjacent cell  in any given timestep in the simulation.  When it does move beyond its  own cell, its movement behavior is the same as for objects of the  <code>Fish</code> class.  <p>  <code>SlowFish</code> objects inherit instance variables and much of  their behavior from the <code>Fish</code> class.  <p>  The <code>SlowFish</code> class is  copyright&copy; 2002 College Entrance Examination Board  (www.collegeboard.com).<P><DL><DT><B>Version: </B><DD>1 July 2002</DD></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="SlowFish.html#SlowFish(Environment, Location)">SlowFish</A></B>(<A HREF="Environment.html">Environment</A>&nbsp;env,         <A HREF="Location.html">Location</A>&nbsp;loc)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a slow fish at the specified location in a  given environment.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="SlowFish.html#SlowFish(Environment, Location, Direction)">SlowFish</A></B>(<A HREF="Environment.html">Environment</A>&nbsp;env,         <A HREF="Location.html">Location</A>&nbsp;loc,         <A HREF="Direction.html">Direction</A>&nbsp;dir)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a slow fish at the specified location and direction in a  given environment.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="SlowFish.html#SlowFish(Environment, Location, Direction, java.awt.Color)">SlowFish</A></B>(<A HREF="Environment.html">Environment</A>&nbsp;env,         <A HREF="Location.html">Location</A>&nbsp;loc,         <A HREF="Direction.html">Direction</A>&nbsp;dir,         java.awt.Color&nbsp;col)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a slow fish of the specified color at the specified  location and direction.</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>protected &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SlowFish.html#generateChild(Location)">generateChild</A></B>(<A HREF="Location.html">Location</A>&nbsp;loc)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new slow fish.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;<A HREF="Location.html">Location</A></CODE></FONT></TD><TD><CODE><B><A HREF="SlowFish.html#nextLocation()">nextLocation</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Finds this fish's next location.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_Fish"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class <A HREF="Fish.html">Fish</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="Fish.html#act()">act</A>, <A HREF="Fish.html#breed()">breed</A>, <A HREF="Fish.html#changeDirection(Direction)">changeDirection</A>, <A HREF="Fish.html#changeLocation(Location)">changeLocation</A>, <A HREF="Fish.html#color()">color</A>, <A HREF="Fish.html#die()">die</A>, <A HREF="Fish.html#direction()">direction</A>, <A HREF="Fish.html#emptyNeighbors()">emptyNeighbors</A>, <A HREF="Fish.html#environment()">environment</A>, <A HREF="Fish.html#id()">id</A>, <A HREF="Fish.html#isInEnv()">isInEnv</A>, <A HREF="Fish.html#location()">location</A>, <A HREF="Fish.html#move()">move</A>, <A HREF="Fish.html#randomColor()">randomColor</A>, <A HREF="Fish.html#toString()">toString</A></CODE></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, wait, wait, wait</CODE></TD></TR></TABLE>&nbsp;<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="SlowFish(Environment, Location)"><!-- --></A><H3>SlowFish</H3><PRE>public <B>SlowFish</B>(<A HREF="Environment.html">Environment</A>&nbsp;env,                <A HREF="Location.html">Location</A>&nbsp;loc)</PRE><DL><DD>Constructs a slow fish at the specified location in a  given environment.   This slow fish is colored red.  (Precondition: parameters are non-null; <code>loc</code> is valid  for <code>env</code>.)<DD><DL><DT><B>Parameters:</B><DD><CODE>env</CODE> - environment in which fish will live<DD><CODE>loc</CODE> - location of the new fish in <code>env</code></DL></DD></DL><HR><A NAME="SlowFish(Environment, Location, Direction)"><!-- --></A><H3>SlowFish</H3><PRE>public <B>SlowFish</B>(<A HREF="Environment.html">Environment</A>&nbsp;env,                <A HREF="Location.html">Location</A>&nbsp;loc,                <A HREF="Direction.html">Direction</A>&nbsp;dir)</PRE><DL><DD>Constructs a slow fish at the specified location and direction in a  given environment.   This slow fish is colored red.  (Precondition: parameters are non-null; <code>loc</code> is valid  for <code>env</code>.)<DD><DL><DT><B>Parameters:</B><DD><CODE>env</CODE> - environment in which fish will live<DD><CODE>loc</CODE> - location of the new fish in <code>env</code><DD><CODE>dir</CODE> - direction the new fish is facing</DL></DD></DL><HR><A NAME="SlowFish(Environment, Location, Direction, java.awt.Color)"><!-- --></A><H3>SlowFish</H3><PRE>public <B>SlowFish</B>(<A HREF="Environment.html">Environment</A>&nbsp;env,                <A HREF="Location.html">Location</A>&nbsp;loc,                <A HREF="Direction.html">Direction</A>&nbsp;dir,                java.awt.Color&nbsp;col)</PRE><DL><DD>Constructs a slow fish of the specified color at the specified  location and direction.  (Precondition: parameters are non-null; <code>loc</code> is valid  for <code>env</code>.)<DD><DL><DT><B>Parameters:</B><DD><CODE>env</CODE> - environment in which fish will live<DD><CODE>loc</CODE> - location of the new fish in <code>env</code><DD><CODE>dir</CODE> - direction the new fish is facing<DD><CODE>col</CODE> - color of the new fish</DL></DD></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="generateChild(Location)"><!-- --></A><H3>generateChild</H3><PRE>protected void <B>generateChild</B>(<A HREF="Location.html">Location</A>&nbsp;loc)</PRE><DL><DD>Creates a new slow fish.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="Fish.html#generateChild(Location)">generateChild</A></CODE> in class <CODE><A HREF="Fish.html">Fish</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>loc</CODE> - location of the new fish</DL></DD></DL><HR><A NAME="nextLocation()"><!-- --></A><H3>nextLocation</H3><PRE>protected <A HREF="Location.html">Location</A> <B>nextLocation</B>()</PRE><DL><DD>Finds this fish's next location.  A slow fish moves so  slowly that it might not move out of its current cell in  the environment.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="Fish.html#nextLocation()">nextLocation</A></CODE> in class <CODE><A HREF="Fish.html">Fish</A></CODE></DL></DD><DD>Following copied from class: <CODE>Fish</CODE></DD><DD><DL><DT><B>Returns:</B><DD>the next location for this fish</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"> &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="Simulation.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="SquareEnvironment.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="SlowFish.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><i>Copyright&copy; 2002 College Entrance Examination Board</i></BODY></HTML>

⌨️ 快捷键说明

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