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

📄 listiterator.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<A NAME="next()"><!-- --></A><H3>next</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>next</B>()</PRE><DL><DD>Returns the next element in the list.  This method may be called repeatedly to iterate through the list, or intermixed with calls to <tt>previous</tt> to go back and forth.  (Note that alternating calls to <tt>next</tt> and <tt>previous</tt> will return the same element repeatedly.)<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Iterator.html#next()">next</A></CODE> in interface <CODE><A HREF="../../java/util/Iterator.html">Iterator</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the next element in the list.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/util/NoSuchElementException.html">NoSuchElementException</A></CODE> - if the iteration has no next element.</DL></DD></DL><HR><A NAME="hasPrevious()"><!-- --></A><H3>hasPrevious</H3><PRE>public boolean <B>hasPrevious</B>()</PRE><DL><DD>Returns <tt>true</tt> if this list iterator has more elements when traversing the list in the reverse direction.  (In other words, returns <tt>true</tt> if <tt>previous</tt> would return an element rather than throwing an exception.)<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD><tt>true</tt> if the list iterator has more elements when	       traversing the list in the reverse direction.</DL></DD></DL><HR><A NAME="previous()"><!-- --></A><H3>previous</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>previous</B>()</PRE><DL><DD>Returns the previous element in the list.  This method may be called repeatedly to iterate through the list backwards, or intermixed with calls to <tt>next</tt> to go back and forth.  (Note that alternating calls to <tt>next</tt> and <tt>previous</tt> will return the same element repeatedly.)<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the previous element in the list.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/util/NoSuchElementException.html">NoSuchElementException</A></CODE> - if the iteration has no previous            element.</DL></DD></DL><HR><A NAME="nextIndex()"><!-- --></A><H3>nextIndex</H3><PRE>public int <B>nextIndex</B>()</PRE><DL><DD>Returns the index of the element that would be returned by a subsequent call to <tt>next</tt>. (Returns list size if the list iterator is at the end of the list.)<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the index of the element that would be returned by a subsequent 	       call to <tt>next</tt>, or list size if list iterator is at end	       of list.</DL></DD></DL><HR><A NAME="previousIndex()"><!-- --></A><H3>previousIndex</H3><PRE>public int <B>previousIndex</B>()</PRE><DL><DD>Returns the index of the element that would be returned by a subsequent call to <tt>previous</tt>. (Returns -1 if the list iterator is at the beginning of the list.)<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the index of the element that would be returned by a subsequent 	       call to <tt>previous</tt>, or -1 if list iterator is at	       beginning of list.</DL></DD></DL><HR><A NAME="remove()"><!-- --></A><H3>remove</H3><PRE>public void <B>remove</B>()</PRE><DL><DD>Removes from the list the last element that was returned by <tt>next</tt> or <tt>previous</tt> (optional operation).  This call can only be made once per call to <tt>next</tt> or <tt>previous</tt>.  It can be made only if <tt>ListIterator.add</tt> has not been called after the last call to <tt>next</tt> or <tt>previous</tt>.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Iterator.html#remove()">remove</A></CODE> in interface <CODE><A HREF="../../java/util/Iterator.html">Iterator</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/UnsupportedOperationException.html">UnsupportedOperationException</A></CODE> - if the <tt>remove</tt> 		  operation is not supported by this list iterator.<DD><CODE><A HREF="../../java/lang/IllegalStateException.html">IllegalStateException</A></CODE> - neither <tt>next</tt> nor		  <tt>previous</tt> have been called, or <tt>remove</tt> or		  <tt>add</tt> have been called after the last call to *		  <tt>next</tt> or <tt>previous</tt>.</DL></DD></DL><HR><A NAME="set(java.lang.Object)"><!-- --></A><H3>set</H3><PRE>public void <B>set</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;o)</PRE><DL><DD>Replaces the last element returned by <tt>next</tt> or <tt>previous</tt> with the specified element (optional operation). This call can be made only if neither <tt>ListIterator.remove</tt> nor <tt>ListIterator.add</tt> have been called after the last call to <tt>next</tt> or <tt>previous</tt>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>o</CODE> - the element with which to replace the last element returned by          <tt>next</tt> or <tt>previous</tt>.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/UnsupportedOperationException.html">UnsupportedOperationException</A></CODE> - if the <tt>set</tt> operation 		  is not supported by this list iterator.<DD><CODE><A HREF="../../java/lang/ClassCastException.html">ClassCastException</A></CODE> - if the class of the specified element 		  prevents it from being added to this list.<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if some aspect of the specified		  element prevents it from being added to this list.<DD><CODE><A HREF="../../java/lang/IllegalStateException.html">IllegalStateException</A></CODE> - if neither <tt>next</tt> nor	          <tt>previous</tt> have been called, or <tt>remove</tt> or		  <tt>add</tt> have been called after the last call to 		  <tt>next</tt> or <tt>previous</tt>.</DL></DD></DL><HR><A NAME="add(java.lang.Object)"><!-- --></A><H3>add</H3><PRE>public void <B>add</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;o)</PRE><DL><DD>Inserts the specified element into the list (optional operation).  The element is inserted immediately before the next element that would be returned by <tt>next</tt>, if any, and after the next element that would be returned by <tt>previous</tt>, if any.  (If the list contains no elements, the new element becomes the sole element on the list.) The new element is inserted before the implicit cursor: a subsequent call to <tt>next</tt> would be unaffected, and a subsequent call to <tt>previous</tt> would return the new element.  (This call increases by one the value that would be returned by a call to <tt>nextIndex</tt> or <tt>previousIndex</tt>.)<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>o</CODE> - the element to insert.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/UnsupportedOperationException.html">UnsupportedOperationException</A></CODE> - if the <tt>add</tt> method is 		  not supported by this list iterator.<DD><CODE><A HREF="../../java/lang/ClassCastException.html">ClassCastException</A></CODE> - if the class of the specified element 		  prevents it from being added to this Set.<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if some aspect of this element            prevents it from being added to this Collection.</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="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ListIterator.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-files/index-1.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>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../java/util/List.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../java/util/Map.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="ListIterator.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;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation  contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A.  All Rights Reserved.</font></BODY></HTML>

⌨️ 快捷键说明

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