📄 abstractiterator.html
字号:
<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="AbstractIterator()"><!-- --></A><H3>AbstractIterator</H3><PRE>public <B>AbstractIterator</B>()</PRE><DL><DD>Default constructor (for base class invocation). Does nothing. Remind Sun (<a href="mailto:jdk-comments@java.sun.com">jdk-comments@java.sun.com</a>) that automatically implemented default constructors are a silly thing.</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="reset()"><!-- --></A><H3>reset</H3><PRE>public abstract void <B>reset</B>()</PRE><DL><DD>Reset iterator to the beginning of the structure. This method is not required of <code>Iterator</code> or <code>Enumeration</code> implementation, but some traversals may allow efficient multi-pass implementations with little overhead. The user is encouraged to implement this method.<DD><DL></DL></DD><DD><DL><DT><B>Precondition:</B><DD>iterator may be initialized or even amid-traversal<DT><B>Postcondition:</B><DD>reset iterator to the beginning of the structure</DL></DD></DL><HR><A NAME="hasNext()"><!-- --></A><H3>hasNext</H3><PRE>public abstract boolean <B>hasNext</B>()</PRE><DL><DD>Returns true if the iterator has more elements to visit. The method <code>hasMoreElements</code> is an <code>Enumeration</code>-required call to this method. The user should override only this method.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html#hasNext()">hasNext</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html">Iterator</A></CODE></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>true iff the iterator has more elements to visit<DT><B>Returns:</B><DD>true iff the iterator has more elements to visit<DT><B>See Also: </B><DD><A HREF="../structure/AbstractIterator.html#hasMoreElements()"><CODE>hasMoreElements()</CODE></A></DL></DD></DL><HR><A NAME="get()"><!-- --></A><H3>get</H3><PRE>public abstract <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> <B>get</B>()</PRE><DL><DD>Returns the value currently being considered by the AbstractIterator. This method is required by neither <code>Iterator</code> nor <code>Enumeration</code>. This method should be implemented, however, to provide better support for <code>for</code>-loops.<DD><DL></DL></DD><DD><DL><DT><B>Precondition:</B><DD>there are more elements to be considered; hasNext()<DT><B>Postcondition:</B><DD>returns current value; ie. value next() will return<DT><B>Returns:</B><DD>the next value to be considered in iterator</DL></DD></DL><HR><A NAME="value()"><!-- --></A><H3>value</H3><PRE>public final <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> <B>value</B>()</PRE><DL><DD><B>Deprecated.</B> <I>This method was deprecated in version 2 of the structure package. Use the get method.</I><P><DD>Returns the value currently being considered by the AbstractIterator. This method is required by neither <code>Iterator</code> nor <code>Enumeration</code>. This method should be implemented, however, to provide better support for <code>for</code>-loops.<DD><DL></DL></DD><DD><DL><DT><B>Precondition:</B><DD>there are more elements to be considered; hasNext()<DT><B>Postcondition:</B><DD>returns the current value; the value next() will return<DT><B>Returns:</B><DD>the next value to be considered in iterator</DL></DD></DL><HR><A NAME="next()"><!-- --></A><H3>next</H3><PRE>public abstract <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> <B>next</B>()</PRE><DL><DD>Moves, bumps, or "increments" the iterator along the traversal; returns the next value considered. This method should only be called if the iterator has a next value. To get a value from an iterator multiple times, use the <code>value</code> method. <p> This method is preferred over the <code>nextElement</code> method.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html#next()">next</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html">Iterator</A></CODE></DL></DD><DD><DL><DT><B>Precondition:</B><DD>hasNext()<DT><B>Postcondition:</B><DD>returns current value, and then increments iterator<DT><B>Returns:</B><DD>the current value<DT><B>See Also: </B><DD><A HREF="../structure/AbstractIterator.html#hasMoreElements()"><CODE>hasMoreElements()</CODE></A>, <A HREF="../structure/AbstractIterator.html#value()"><CODE>value()</CODE></A></DL></DD></DL><HR><A NAME="remove()"><!-- --></A><H3>remove</H3><PRE>public void <B>remove</B>()</PRE><DL><DD>If implemented, removes the currently visited value from the structure. <code>remove</code> should not be called unless it is overridden.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html#remove()">remove</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html">Iterator</A></CODE></DL></DD><DD><DL><DT><B>Precondition:</B><DD>hasNext() is true and get() has not been called<DT><B>Postcondition:</B><DD>the value has been removed from the structure</DL></DD></DL><HR><A NAME="hasMoreElements()"><!-- --></A><H3>hasMoreElements</H3><PRE>public final boolean <B>hasMoreElements</B>()</PRE><DL><DD>An Enumeration method that is equivalent to <A HREF="../structure/AbstractIterator.html#hasNext()"><CODE>hasNext()</CODE></A>. Extensions to this class should provide a <code>hasNext</code> method.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Enumeration.html#hasMoreElements()">hasMoreElements</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Enumeration.html">Enumeration</A></CODE></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>returns true iff there are more elements<DT><B>Returns:</B><DD>returns true iff there are more elements</DL></DD></DL><HR><A NAME="nextElement()"><!-- --></A><H3>nextElement</H3><PRE>public final <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> <B>nextElement</B>()</PRE><DL><DD>An Enumeration method that is equivalent to <A HREF="../structure/AbstractIterator.html#next()"><CODE>next()</CODE></A>. Extensions to this class should provide a <code>next</code> method.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Enumeration.html#nextElement()">nextElement</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Enumeration.html">Enumeration</A></CODE></DL></DD><DD><DL><DT><B>Precondition:</B><DD>hasNext()<DT><B>Postcondition:</B><DD>returns the current value and "increments" the iterator<DT><B>Returns:</B><DD>the current value before iterator is incremented</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="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</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><a href=../copyright.html target=_top>© 1998-2002 McGraw-Hill</a></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../structure/AbstractLinear.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="AbstractIterator.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></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -