📄 direction.html
字号:
<B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="NORTH"><!-- --></A><H3>NORTH</H3><PRE>public static final <A HREF="Direction.html">Direction</A> <B>NORTH</B></PRE><DL></DL><HR><A NAME="NORTHEAST"><!-- --></A><H3>NORTHEAST</H3><PRE>public static final <A HREF="Direction.html">Direction</A> <B>NORTHEAST</B></PRE><DL></DL><HR><A NAME="EAST"><!-- --></A><H3>EAST</H3><PRE>public static final <A HREF="Direction.html">Direction</A> <B>EAST</B></PRE><DL></DL><HR><A NAME="SOUTHEAST"><!-- --></A><H3>SOUTHEAST</H3><PRE>public static final <A HREF="Direction.html">Direction</A> <B>SOUTHEAST</B></PRE><DL></DL><HR><A NAME="SOUTH"><!-- --></A><H3>SOUTH</H3><PRE>public static final <A HREF="Direction.html">Direction</A> <B>SOUTH</B></PRE><DL></DL><HR><A NAME="SOUTHWEST"><!-- --></A><H3>SOUTHWEST</H3><PRE>public static final <A HREF="Direction.html">Direction</A> <B>SOUTHWEST</B></PRE><DL></DL><HR><A NAME="WEST"><!-- --></A><H3>WEST</H3><PRE>public static final <A HREF="Direction.html">Direction</A> <B>WEST</B></PRE><DL></DL><HR><A NAME="NORTHWEST"><!-- --></A><H3>NORTHWEST</H3><PRE>public static final <A HREF="Direction.html">Direction</A> <B>NORTHWEST</B></PRE><DL></DL><HR><A NAME="FULL_CIRCLE"><!-- --></A><H3>FULL_CIRCLE</H3><PRE>public static final int <B>FULL_CIRCLE</B></PRE><DL><DD>Number of degrees in compass (will not be tested on the Advanced Placement exam).</DL><!-- ========= 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="Direction()"><!-- --></A><H3>Direction</H3><PRE>public <B>Direction</B>()</PRE><DL><DD>Constructs a default <code>Direction</code> object facing North.</DL><HR><A NAME="Direction(int)"><!-- --></A><H3>Direction</H3><PRE>public <B>Direction</B>(int degrees)</PRE><DL><DD>Constructs a <code>Direction</code> object.<DD><DL><DT><B>Parameters:</B><DD><CODE>degrees</CODE> - initial compass direction in degrees</DL></DD></DL><HR><A NAME="Direction(java.lang.String)"><!-- --></A><H3>Direction</H3><PRE>public <B>Direction</B>(java.lang.String str)</PRE><DL><DD>Constructs a <code>Direction</code> object.<DD><DL><DT><B>Parameters:</B><DD><CODE>str</CODE> - compass direction specified as a string, e.g. "North"<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if string doesn't match a known direction name</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="inDegrees()"><!-- --></A><H3>inDegrees</H3><PRE>public int <B>inDegrees</B>()</PRE><DL><DD>Returns this direction value in degrees.<DD><DL><DT><B>Returns:</B><DD>the value of this <code>Direction</code> object in degrees</DL></DD></DL><HR><A NAME="equals(java.lang.Object)"><!-- --></A><H3>equals</H3><PRE>public boolean <B>equals</B>(java.lang.Object other)</PRE><DL><DD>Indicates whether some other <code>Direction</code> object is "equal to" this one.<DD><DL><DT><B>Overrides:</B><DD><CODE>equals</CODE> in class <CODE>java.lang.Object</CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>other</CODE> - the other position to test<DT><B>Returns:</B><DD><code>true</code> if <code>other</code> represents the same direction; <code>false</code> otherwise</DL></DD></DL><HR><A NAME="hashCode()"><!-- --></A><H3>hashCode</H3><PRE>public int <B>hashCode</B>()</PRE><DL><DD>Generates a hash code for this direction (will not be tested on the Advanced Placement exam).<DD><DL><DT><B>Overrides:</B><DD><CODE>hashCode</CODE> in class <CODE>java.lang.Object</CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a hash code for a <code>Direction</code> object</DL></DD></DL><HR><A NAME="toRight()"><!-- --></A><H3>toRight</H3><PRE>public <A HREF="Direction.html">Direction</A> <B>toRight</B>()</PRE><DL><DD>Returns the direction that is a quarter turn to the right of this <code>Direction</code> object.<DD><DL><DT><B>Returns:</B><DD>the new direction</DL></DD></DL><HR><A NAME="toRight(int)"><!-- --></A><H3>toRight</H3><PRE>public <A HREF="Direction.html">Direction</A> <B>toRight</B>(int deg)</PRE><DL><DD>Returns the direction that is <code>deg</code> degrees to the right of this <code>Direction</code> object.<DD><DL><DT><B>Parameters:</B><DD><CODE>deg</CODE> - the number of degrees to turn<DT><B>Returns:</B><DD>the new direction</DL></DD></DL><HR><A NAME="toLeft()"><!-- --></A><H3>toLeft</H3><PRE>public <A HREF="Direction.html">Direction</A> <B>toLeft</B>()</PRE><DL><DD>Returns the direction that is a quarter turn to the left of this <code>Direction</code> object.<DD><DL><DT><B>Returns:</B><DD>the new direction</DL></DD></DL><HR><A NAME="toLeft(int)"><!-- --></A><H3>toLeft</H3><PRE>public <A HREF="Direction.html">Direction</A> <B>toLeft</B>(int deg)</PRE><DL><DD>Returns the direction that is <code>deg</code> degrees to the left of this <code>Direction</code> object.<DD><DL><DT><B>Parameters:</B><DD><CODE>deg</CODE> - the number of degrees to turn<DT><B>Returns:</B><DD>the new direction</DL></DD></DL><HR><A NAME="reverse()"><!-- --></A><H3>reverse</H3><PRE>public <A HREF="Direction.html">Direction</A> <B>reverse</B>()</PRE><DL><DD>Returns the direction that is the reverse of this <code>Direction</code> object.<DD><DL><DT><B>Returns:</B><DD>the reverse direction</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public java.lang.String <B>toString</B>()</PRE><DL><DD>Represents this direction as a string.<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 the direction</DL></DD></DL><HR><A NAME="roundedDir(int, Direction)"><!-- --></A><H3>roundedDir</H3><PRE>public <A HREF="Direction.html">Direction</A> <B>roundedDir</B>(int numDirections, <A HREF="Direction.html">Direction</A> startingDir)</PRE><DL><DD>Rounds this direction to the nearest "cardinal" direction (will not be tested on the Advanced Placement exam).<br> The choice of possible cardinal directions depends on the number of cardinal directions and the starting direction. For example, the two cardinal directions starting at NORTH are NORTH and SOUTH. The two cardinal directions starting at EAST are EAST and WEST. The four cardinal directions starting at NORTH are NORTH, EAST, SOUTH, and WEST. The four cardinal directions starting from NORTHEAST are NORTHEAST, SOUTHEAST, SOUTHWEST, and NORTHWEST. (Precondition: 0 < numDirections <= 360)<DD><DL><DT><B>Parameters:</B><DD><CODE>numDirections</CODE> - the number of "cardinal" directions<DD><CODE>startingDir</CODE> - the starting cardinal direction<DT><B>Returns:</B><DD>the current direction rounded to a "cardinal" direction</DL></DD></DL><HR><A NAME="randomDirection()"><!-- --></A><H3>randomDirection</H3><PRE>public static <A HREF="Direction.html">Direction</A> <B>randomDirection</B>()</PRE><DL><DD>Returns a random direction.<DD><DL><DT><B>Returns:</B><DD>a direction</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="Debug.html"><B>PREV CLASS</B></A> <A HREF="EnvDisplay.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> <A HREF="Direction.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <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 + -