Arrays 源码解读

/**
 * 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;


//取消默认构造函数,确保不可实例化。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值