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

📄 list.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>get</B>(int&nbsp;index)</PRE><DL><DD>Returns the element at the specified position in this list.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - index of element to return.<DT><B>Returns:</B><DD>the element at the specified position in this list.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</A></CODE> - if the index is out of range (index 		  &lt; 0 || index &gt;= size()).</DL></DD></DL><HR><A NAME="set(int, java.lang.Object)"><!-- --></A><H3>set</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>set</B>(int&nbsp;index,                  <A HREF="../../java/lang/Object.html">Object</A>&nbsp;element)</PRE><DL><DD>Replaces the element at the specified position in this list with the specified element (optional operation).<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - index of element to replace.<DD><CODE>element</CODE> - element to be stored at the specified position.<DT><B>Returns:</B><DD>the element previously at the specified position.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/UnsupportedOperationException.html">UnsupportedOperationException</A></CODE> - if the <tt>set</tt> method is not		  supported by this list.<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/IndexOutOfBoundsException.html">IndexOutOfBoundsException</A></CODE> - if the index is out of range		  (index &lt; 0 || index &gt;= size()).</DL></DD></DL><HR><A NAME="add(int, java.lang.Object)"><!-- --></A><H3>add</H3><PRE>public void <B>add</B>(int&nbsp;index,                <A HREF="../../java/lang/Object.html">Object</A>&nbsp;element)</PRE><DL><DD>Inserts the specified element at the specified position in this list (optional operation).  Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - index at which the specified element is to be inserted.<DD><CODE>element</CODE> - element to be inserted.<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.<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/IndexOutOfBoundsException.html">IndexOutOfBoundsException</A></CODE> - if the index is out of range		  (index &lt; 0 || index &gt; size()).</DL></DD></DL><HR><A NAME="remove(int)"><!-- --></A><H3>remove</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>remove</B>(int&nbsp;index)</PRE><DL><DD>Removes the element at the specified position in this list (optional operation).  Shifts any subsequent elements to the left (subtracts one from their indices).  Returns the element that was removed from the list.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the element to removed.<DT><B>Returns:</B><DD>the element previously at the specified position.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/UnsupportedOperationException.html">UnsupportedOperationException</A></CODE> - if the <tt>remove</tt> method is		  not supported by this list.<DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</A></CODE> - if the index is out of range (index            &lt; 0 || index &gt;= size()).</DL></DD></DL><HR><A NAME="indexOf(java.lang.Object)"><!-- --></A><H3>indexOf</H3><PRE>public int <B>indexOf</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;o)</PRE><DL><DD>Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element. More formally, returns the lowest index <tt>i</tt> such that <tt>(o==null ? get(i)==null : o.equals(get(i)))</tt>, or -1 if there is no such index.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>o</CODE> - element to search for.<DT><B>Returns:</B><DD>the index in this list of the first occurrence of the specified 	       element, or -1 if this list does not contain this element.</DL></DD></DL><HR><A NAME="lastIndexOf(java.lang.Object)"><!-- --></A><H3>lastIndexOf</H3><PRE>public int <B>lastIndexOf</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;o)</PRE><DL><DD>Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element. More formally, returns the highest index <tt>i</tt> such that <tt>(o==null ? get(i)==null : o.equals(get(i)))</tt>, or -1 if there is no such index.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>o</CODE> - element to search for.<DT><B>Returns:</B><DD>the index in this list of the last occurrence of the specified 	       element, or -1 if this list does not contain this element.</DL></DD></DL><HR><A NAME="listIterator()"><!-- --></A><H3>listIterator</H3><PRE>public <A HREF="../../java/util/ListIterator.html">ListIterator</A> <B>listIterator</B>()</PRE><DL><DD>Returns a list iterator of the elements in this list (in proper sequence).<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a list iterator of the elements in this list (in proper 	       sequence).</DL></DD></DL><HR><A NAME="listIterator(int)"><!-- --></A><H3>listIterator</H3><PRE>public <A HREF="../../java/util/ListIterator.html">ListIterator</A> <B>listIterator</B>(int&nbsp;index)</PRE><DL><DD>Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list.  The specified index indicates the first element that would be returned by an initial call to the <tt>next</tt> method.  An initial call to the <tt>previous</tt> method would return the element with the specified index minus one.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - index of first element to be returned from the		    list iterator (by a call to the <tt>next</tt> method).<DT><B>Returns:</B><DD>a list iterator of the elements in this list (in proper 	       sequence), starting at the specified position in this list.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</A></CODE> - if the index is out of range (index         &lt; 0 || index &gt; size()).</DL></DD></DL><HR><A NAME="subList(int, int)"><!-- --></A><H3>subList</H3><PRE>public <A HREF="../../java/util/List.html">List</A> <B>subList</B>(int&nbsp;fromIndex,                    int&nbsp;toIndex)</PRE><DL><DD>Returns a view of the portion of this list between the specified <tt>fromIndex</tt>, inclusive, and <tt>toIndex</tt>, exclusive.  (If <tt>fromIndex</tt> and <tt>toIndex</tt> are equal, the returned list is empty.)  The returned list is backed by this list, so changes in the returned list are reflected in this list, and vice-versa.  The returned list supports all of the optional list operations supported by this list.<p> This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays).   Any operation that expects a list can be used as a range operation by passing a subList view instead of a whole list.  For example, the following idiom removes a range of elements from a list: <pre>	    list.subList(from, to).clear(); </pre> Similar idioms may be constructed for <tt>indexOf</tt> and <tt>lastIndexOf</tt>, and all of the algorithms in the <tt>Collections</tt> class can be applied to a subList.<p> The semantics of this list returned by this method become undefined if the backing list (i.e., this list) is <i>structurally modified</i> in any way other than via the returned list.  (Structural modifications are those that change the size of this list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.)<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>fromIndex</CODE> - low endpoint (inclusive) of the subList.<DD><CODE>toIndex</CODE> - high endpoint (exclusive) of the subList.<DT><B>Returns:</B><DD>a view of the specified range within this list.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</A></CODE> - for an illegal endpoint index value     (fromIndex &lt; 0 || toIndex &gt; size || fromIndex &gt; toIndex).</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/List.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/Iterator.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../java/util/ListIterator.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="List.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 + -