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

📄 collections.html

📁 j2se5-api-zh,java文档的中文版本
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<CODE>static<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T extends <A HREF="../lang/Object.html" title="java.lang 中的类">Object</A> & <A HREF="../lang/Comparable.html" title="java.lang 中的接口">Comparable</A>&lt;? super T&gt;&gt; <BR>T</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B><A HREF="Collections.html#min(java.util.Collection)">min</A></B>(<A HREF="Collection.html" title="java.util 中的接口">Collection</A>&lt;? extends T&gt;&nbsp;coll)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;根据元素的<i>自然顺序</i> 返回给定 collection 的最小元素。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T&gt; T</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B><A HREF="Collections.html#min(java.util.Collection, java.util.Comparator)">min</A></B>(<A HREF="Collection.html" title="java.util 中的接口">Collection</A>&lt;? extends T&gt;&nbsp;coll,    <A HREF="Comparator.html" title="java.util 中的接口">Comparator</A>&lt;? super T&gt;&nbsp;comp)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;根据指定比较器产生的顺序,返回给定 collection 的最小元素。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T&gt; <A HREF="List.html" title="java.util 中的接口">List</A>&lt;T&gt;</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B><A HREF="Collections.html#nCopies(int, T)">nCopies</A></B>(int&nbsp;n,        T&nbsp;o)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回由指定对象的 <tt>n</tt> 个副本组成的不可变列表。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T&gt; boolean</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B><A HREF="Collections.html#replaceAll(java.util.List, T, T)">replaceAll</A></B>(<A HREF="List.html" title="java.util 中的接口">List</A>&lt;T&gt;&nbsp;list,           T&nbsp;oldVal,           T&nbsp;newVal)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;使用另一个值替换列表中出现的所有某一指定值。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="Collections.html#reverse(java.util.List)">reverse</A></B>(<A HREF="List.html" title="java.util 中的接口">List</A>&lt;?&gt;&nbsp;list)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;反转指定列表中元素的顺序。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T&gt; <A HREF="Comparator.html" title="java.util 中的接口">Comparator</A>&lt;T&gt;</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B><A HREF="Collections.html#reverseOrder()">reverseOrder</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回一个比较器,它强行反转实现 <tt>Comparable</tt> 接口那些对象 collection 上的<i>自然顺序</i>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T&gt; <A HREF="Comparator.html" title="java.util 中的接口">Comparator</A>&lt;T&gt;</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B><A HREF="Collections.html#reverseOrder(java.util.Comparator)">reverseOrder</A></B>(<A HREF="Comparator.html" title="java.util 中的接口">Comparator</A>&lt;T&gt;&nbsp;cmp)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回一个比较器,它强行反转指定比较器的顺序。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="Collections.html#rotate(java.util.List, int)">rotate</A></B>(<A HREF="List.html" title="java.util 中的接口">List</A>&lt;?&gt;&nbsp;list,       int&nbsp;distance)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;根据指定的距离循环移动指定列表中的元素。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="Collections.html#shuffle(java.util.List)">shuffle</A></B>(<A HREF="List.html" title="java.util 中的接口">List</A>&lt;?&gt;&nbsp;list)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;使用默认随机源随机更改指定列表的序列。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="Collections.html#shuffle(java.util.List, java.util.Random)">shuffle</A></B>(<A HREF="List.html" title="java.util 中的接口">List</A>&lt;?&gt;&nbsp;list,        <A HREF="Random.html" title="java.util 中的类">Random</A>&nbsp;rnd)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;使用指定的随机源随机更改指定列表的序列。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T&gt; <A HREF="Set.html" title="java.util 中的接口">Set</A>&lt;T&gt;</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B><A HREF="Collections.html#singleton(T)">singleton</A></B>(T&nbsp;o)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回一个只包含指定对象的不可变 set。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T&gt; <A HREF="List.html" title="java.util 中的接口">List</A>&lt;T&gt;</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B><A HREF="Collections.html#singletonList(T)">singletonList</A></B>(T&nbsp;o)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回一个只包含指定对象的不可变列表。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;K,V&gt; <A HREF="Map.html" title="java.util 中的接口">Map</A>&lt;K,V&gt;</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B><A HREF="Collections.html#singletonMap(K, V)">singletonMap</A></B>(K&nbsp;key,             V&nbsp;value)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回一个不可变的映射,它只将指定键映射到指定值。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T extends <A HREF="../lang/Comparable.html" title="java.lang 中的接口">Comparable</A>&lt;? super T&gt;&gt; <BR>void</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B><A HREF="Collections.html#sort(java.util.List)">sort</A></B>(<A HREF="List.html" title="java.util 中的接口">List</A>&lt;T&gt;&nbsp;list)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;根据元素的<i>自然顺序</i> 对指定列表按升序进行排序。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T&gt; void</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B><A HREF="Collections.html#sort(java.util.List, java.util.Comparator)">sort</A></B>(<A HREF="List.html" title="java.util 中的接口">List</A>&lt;T&gt;&nbsp;list,     <A HREF="Comparator.html" title="java.util 中的接口">Comparator</A>&lt;? super T&gt;&nbsp;c)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;根据指定比较器产生的顺序对指定列表进行排序。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="Collections.html#swap(java.util.List, int, int)">swap</A></B>(<A HREF="List.html" title="java.util 中的接口">List</A>&lt;?&gt;&nbsp;list,     int&nbsp;i,     int&nbsp;j)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在指定列表的指定位置处交换元素。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T&gt; <A HREF="Collection.html" title="java.util 中的接口">Collection</A>&lt;T&gt;</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B><A HREF="Collections.html#synchronizedCollection(java.util.Collection)">synchronizedCollection</A></B>(<A HREF="Collection.html" title="java.util 中的接口">Collection</A>&lt;T&gt;&nbsp;c)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回由指定 collection 支持的同步(线程安全的)collection。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T&gt; <A HREF="List.html" title="java.util 中的接口">List</A>&lt;T&gt;</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B><A HREF="Collections.html#synchronizedList(java.util.List)">synchronizedList</A></B>(<A HREF="List.html" title="java.util 中的接口">List</A>&lt;T&gt;&nbsp;list)</CODE><BR>

⌨️ 快捷键说明

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