复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71/** * This class contains various methods for manipulating arrays (such as * sorting and searching). This class also contains a static factory * that allows arrays to be viewed as lists. * * <p>The methods in this class all throw a {@code NullPointerException}, * if the specified array reference is null, except where noted. * * <p>The documentation for the methods contained in this class includes * briefs description of the <i>implementations</i>. Such descriptions should * be regarded as <i>implementation notes</i>, rather than parts of the * <i>specification</i>. Implementors should feel free to substitute other * algorithms, so long as the specification itself is adhered to. (For * example, the algorithm used by {@code sort(Object[])} does not have to be * a MergeSort, but it does have to be <i>stable</i>.) * * <p>This class is a member of the * <a href="{@docRoot}/../technotes/guides/collections/index.html"> * Java Collections Framework</a>. * * @author Josh Bloch * @author Neal Gafter * @author John Rose * @since 1.2 */ public class Arrays { /** * The minimum array length below which a parallel sorting * algorithm will not further partition the sorting task. Using * smaller sizes typically results in memory contention across * tasks that makes parallel speedups unlikely. */ private static final int MIN_ARRAY_SORT_GRAN = 1 << 13; // Suppresses default constructor, ensuring non-instantiability. **解释** /** *此类包含用于操作数组的各种方法(例如 *排序和搜索)。此类还包含静态工厂 *这样就可以将数组视为列表。 * *<p>此类中的方法都会引发@code nullpointerException, *如果指定的数组引用为空,除非另有说明。 * *<p>此类中包含的方法的文档包括 *简要介绍<i>实现的说明。这种描述应该 *被视为实施说明,而不是 *<i>规格。实施者应该可以自由地替换其他的 *算法,只要遵守规范本身。(用于 *例如,@code sort(object[])使用的算法不必是 *合并排序,但它必须是稳定的。 * *<p>这个班是 *<a href=“@docroot/…/technotes/guides/collections/index.html”> * Java集合框架</a>。 * *@作者乔什·布洛赫 *@作者Neal Gafter *@作家约翰·罗斯 *@自1.2起 */ 公共类数组{ /** *并行排序的最小数组长度 *算法不会进一步划分排序任务。使用 *较小的大小通常会导致内存争用 *使并行加速不太可能的任务。 */ private static final int min_array_sort_gran=1<<13; //取消默认构造函数,确保不可实例化。
最后
以上就是过时花生最近收集整理的关于Arrays 源码解读的全部内容,更多相关Arrays内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复