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

📄 list.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<DD>Returns an array containing all of the elements in this list in proper sequence; the runtime type of the returned array is that of the specified array.  Obeys the general contract of the <tt>Collection.toArray(Object[])</tt> method.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Collection.html#toArray(java.lang.Object[])">toArray</A></CODE> in interface <CODE><A HREF="../../java/util/Collection.html">Collection</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>a</CODE> - the array into which the elements of this list are to		be stored, if it is big enough; otherwise, a new array of the 		same runtime type is allocated for this purpose.<DT><B>Returns:</B><DD>an array containing the elements of this list.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/ArrayStoreException.html">ArrayStoreException</A></CODE> - if the runtime type of the specified array 		  is not a supertype of the runtime type of every element in 		  this list.</DL></DD></DL><HR><A NAME="add(java.lang.Object)"><!-- --></A><H3>add</H3><PRE>public boolean <B>add</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;o)</PRE><DL><DD>Appends the specified element to the end of this list (optional operation). <p> Lists that support this operation may place limitations on what elements may be added to this list.  In particular, some lists will refuse to add null elements, and others will impose restrictions on the type of elements that may be added.  List classes should clearly specify in their documentation any restrictions on what elements may be added.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Collection.html#add(java.lang.Object)">add</A></CODE> in interface <CODE><A HREF="../../java/util/Collection.html">Collection</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>o</CODE> - element to be appended to this list.<DT><B>Returns:</B><DD><tt>true</tt> (as per the general contract of the            <tt>Collection.add</tt> method).<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 this element            prevents it from being added to this collection.</DL></DD></DL><HR><A NAME="remove(java.lang.Object)"><!-- --></A><H3>remove</H3><PRE>public boolean <B>remove</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;o)</PRE><DL><DD>Removes the first occurrence in this list of the specified element  (optional operation).  If this list does not contain the element, it is unchanged.  More formally, removes the element with the lowest index i such that <tt>(o==null ? get(i)==null : o.equals(get(i)))</tt> (if such an element exists).<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Collection.html#remove(java.lang.Object)">remove</A></CODE> in interface <CODE><A HREF="../../java/util/Collection.html">Collection</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>o</CODE> - element to be removed from this list, if present.<DT><B>Returns:</B><DD><tt>true</tt> if this list contained the specified element.<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.</DL></DD></DL><HR><A NAME="containsAll(java.util.Collection)"><!-- --></A><H3>containsAll</H3><PRE>public boolean <B>containsAll</B>(<A HREF="../../java/util/Collection.html">Collection</A>&nbsp;c)</PRE><DL><DD>Returns <tt>true</tt> if this list contains all of the elements of the specified collection.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Collection.html#containsAll(java.util.Collection)">containsAll</A></CODE> in interface <CODE><A HREF="../../java/util/Collection.html">Collection</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - collection to be checked for containment in this list.<DT><B>Returns:</B><DD><tt>true</tt> if this list contains all of the elements of the 	       specified collection.<DT><B>See Also: </B><DD><A HREF="../../java/util/List.html#contains(java.lang.Object)"><CODE>contains(Object)</CODE></A></DL></DD></DL><HR><A NAME="addAll(java.util.Collection)"><!-- --></A><H3>addAll</H3><PRE>public boolean <B>addAll</B>(<A HREF="../../java/util/Collection.html">Collection</A>&nbsp;c)</PRE><DL><DD>Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation).  The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress.  (Note that this will occur if the specified collection is this list, and it's nonempty.)<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Collection.html#addAll(java.util.Collection)">addAll</A></CODE> in interface <CODE><A HREF="../../java/util/Collection.html">Collection</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - collection whose elements are to be added to this list.<DT><B>Returns:</B><DD><tt>true</tt> if this list changed as a result of the call.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/UnsupportedOperationException.html">UnsupportedOperationException</A></CODE> - if the <tt>addAll</tt> method is         not supported by this list.<DD><CODE><A HREF="../../java/lang/ClassCastException.html">ClassCastException</A></CODE> - if the class of an element in the specified 	       collection prevents it from being added to this list.<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if some aspect of an element in the         specified collection prevents it from being added to this         list.<DT><B>See Also: </B><DD><A HREF="../../java/util/List.html#add(java.lang.Object)"><CODE>add(Object)</CODE></A></DL></DD></DL><HR><A NAME="addAll(int, java.util.Collection)"><!-- --></A><H3>addAll</H3><PRE>public boolean <B>addAll</B>(int&nbsp;index,                      <A HREF="../../java/util/Collection.html">Collection</A>&nbsp;c)</PRE><DL><DD>Inserts all of the elements in the specified collection into this list at the specified position (optional operation).  Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices).  The new elements will appear in this list in the order that they are returned by the specified collection's iterator.  The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress.  (Note that this will occur if the specified collection is this list, and it's nonempty.)<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - index at which to insert first element from the specified	            collection.<DD><CODE>c</CODE> - elements to be inserted into this list.<DT><B>Returns:</B><DD><tt>true</tt> if this list changed as a result of the call.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/UnsupportedOperationException.html">UnsupportedOperationException</A></CODE> - if the <tt>addAll</tt> method is		  not supported by this list.<DD><CODE><A HREF="../../java/lang/ClassCastException.html">ClassCastException</A></CODE> - if the class of one of elements of the 		  specified collection prevents it from being added to this 		  list.<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if some aspect of one of elements of		  the specified collection 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="removeAll(java.util.Collection)"><!-- --></A><H3>removeAll</H3><PRE>public boolean <B>removeAll</B>(<A HREF="../../java/util/Collection.html">Collection</A>&nbsp;c)</PRE><DL><DD>Removes from this list all the elements that are contained in the specified collection (optional operation).<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Collection.html#removeAll(java.util.Collection)">removeAll</A></CODE> in interface <CODE><A HREF="../../java/util/Collection.html">Collection</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - collection that defines which elements will be removed from          this list.<DT><B>Returns:</B><DD><tt>true</tt> if this list changed as a result of the call.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/UnsupportedOperationException.html">UnsupportedOperationException</A></CODE> - if the <tt>removeAll</tt> method 		  is not supported by this list.<DT><B>See Also: </B><DD><A HREF="../../java/util/List.html#remove(java.lang.Object)"><CODE>remove(Object)</CODE></A>, <A HREF="../../java/util/List.html#contains(java.lang.Object)"><CODE>contains(Object)</CODE></A></DL></DD></DL><HR><A NAME="retainAll(java.util.Collection)"><!-- --></A><H3>retainAll</H3><PRE>public boolean <B>retainAll</B>(<A HREF="../../java/util/Collection.html">Collection</A>&nbsp;c)</PRE><DL><DD>Retains only the elements in this list that are contained in the specified collection (optional operation).  In other words, removes from this list all the elements that are not contained in the specified collection.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Collection.html#retainAll(java.util.Collection)">retainAll</A></CODE> in interface <CODE><A HREF="../../java/util/Collection.html">Collection</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - collection that defines which elements this set will retain.<DT><B>Returns:</B><DD><tt>true</tt> if this list changed as a result of the call.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/UnsupportedOperationException.html">UnsupportedOperationException</A></CODE> - if the <tt>retainAll</tt> method 		  is not supported by this list.<DT><B>See Also: </B><DD><A HREF="../../java/util/List.html#remove(java.lang.Object)"><CODE>remove(Object)</CODE></A>, <A HREF="../../java/util/List.html#contains(java.lang.Object)"><CODE>contains(Object)</CODE></A></DL></DD></DL><HR><A NAME="clear()"><!-- --></A><H3>clear</H3><PRE>public void <B>clear</B>()</PRE><DL><DD>Removes all of the elements from this list (optional operation).  This list will be empty after this call returns (unless it throws an exception).<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Collection.html#clear()">clear</A></CODE> in interface <CODE><A HREF="../../java/util/Collection.html">Collection</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/UnsupportedOperationException.html">UnsupportedOperationException</A></CODE> - if the <tt>clear</tt> method is 		  not supported by this list.</DL></DD></DL><HR><A NAME="equals(java.lang.Object)"><!-- --></A><H3>equals</H3><PRE>public boolean <B>equals</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;o)</PRE><DL><DD>Compares the specified object with this list for equality.  Returns <tt>true</tt> if and only if the specified object is also a list, both lists have the same size, and all corresponding pairs of elements in the two lists are <i>equal</i>.  (Two elements <tt>e1</tt> and <tt>e2</tt> are <i>equal</i> if <tt>(e1==null ? e2==null : e1.equals(e2))</tt>.)  In other words, two lists are defined to be equal if they contain the same elements in the same order.  This definition ensures that the equals method works properly across different implementations of the <tt>List</tt> interface.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Collection.html#equals(java.lang.Object)">equals</A></CODE> in interface <CODE><A HREF="../../java/util/Collection.html">Collection</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>o</CODE> - the object to be compared for equality with this list.<DT><B>Returns:</B><DD><tt>true</tt> if the specified object is equal to this list.</DL></DD></DL><HR><A NAME="hashCode()"><!-- --></A><H3>hashCode</H3><PRE>public int <B>hashCode</B>()</PRE><DL><DD>Returns the hash code value for this list.  The hash code of a list is defined to be the result of the following calculation: <pre>  hashCode = 1;  Iterator i = list.iterator();  while (i.hasNext()) {      Object obj = i.next();      hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode());  } </pre> This ensures that <tt>list1.equals(list2)</tt> implies that <tt>list1.hashCode()==list2.hashCode()</tt> for any two lists, <tt>list1</tt> and <tt>list2</tt>, as required by the general contract of <tt>Object.hashCode</tt>.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Collection.html#hashCode()">hashCode</A></CODE> in interface <CODE><A HREF="../../java/util/Collection.html">Collection</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#hashCode()">hashCode</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the hash code value for this list.<DT><B>See Also: </B><DD><A HREF="../../java/lang/Object.html#hashCode()"><CODE>Object.hashCode()</CODE></A>, <A HREF="../../java/lang/Object.html#equals(java.lang.Object)"><CODE>Object.equals(Object)</CODE></A>, <A HREF="../../java/util/List.html#equals(java.lang.Object)"><CODE>equals(Object)</CODE></A></DL></DD></DL><HR><A NAME="get(int)"><!-- --></A><H3>get</H3>

⌨️ 快捷键说明

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