< prev index next >

src/java.base/share/classes/java/util/Arrays.java

Print this page




  46 import java.util.stream.Stream;
  47 import java.util.stream.StreamSupport;
  48 
  49 /**
  50  * This class contains various methods for manipulating arrays (such as
  51  * sorting and searching). This class also contains a static factory
  52  * that allows arrays to be viewed as lists.
  53  *
  54  * <p>The methods in this class all throw a {@code NullPointerException},
  55  * if the specified array reference is null, except where noted.
  56  *
  57  * <p>The documentation for the methods contained in this class includes
  58  * brief descriptions of the <i>implementations</i>. Such descriptions should
  59  * be regarded as <i>implementation notes</i>, rather than parts of the
  60  * <i>specification</i>. Implementors should feel free to substitute other
  61  * algorithms, so long as the specification itself is adhered to. (For
  62  * example, the algorithm used by {@code sort(Object[])} does not have to be
  63  * a MergeSort, but it does have to be <i>stable</i>.)
  64  *
  65  * <p>This class is a member of the
  66  * <a href="{@docRoot}/java/util/package-summary.html#CollectionsFramework">
  67  * Java Collections Framework</a>.
  68  *
  69  * @author Josh Bloch
  70  * @author Neal Gafter
  71  * @author John Rose
  72  * @since  1.2
  73  */
  74 public class Arrays {
  75 
  76     /**
  77      * The minimum array length below which a parallel sorting
  78      * algorithm will not further partition the sorting task. Using
  79      * smaller sizes typically results in memory contention across
  80      * tasks that makes parallel speedups unlikely.
  81      */
  82     private static final int MIN_ARRAY_SORT_GRAN = 1 << 13;
  83 
  84     // Suppresses default constructor, ensuring non-instantiability.
  85     private Arrays() {}
  86 




  46 import java.util.stream.Stream;
  47 import java.util.stream.StreamSupport;
  48 
  49 /**
  50  * This class contains various methods for manipulating arrays (such as
  51  * sorting and searching). This class also contains a static factory
  52  * that allows arrays to be viewed as lists.
  53  *
  54  * <p>The methods in this class all throw a {@code NullPointerException},
  55  * if the specified array reference is null, except where noted.
  56  *
  57  * <p>The documentation for the methods contained in this class includes
  58  * brief descriptions of the <i>implementations</i>. Such descriptions should
  59  * be regarded as <i>implementation notes</i>, rather than parts of the
  60  * <i>specification</i>. Implementors should feel free to substitute other
  61  * algorithms, so long as the specification itself is adhered to. (For
  62  * example, the algorithm used by {@code sort(Object[])} does not have to be
  63  * a MergeSort, but it does have to be <i>stable</i>.)
  64  *
  65  * <p>This class is a member of the
  66  * <a href="{@docRoot}/java.base/java/util/package-summary.html#CollectionsFramework">
  67  * Java Collections Framework</a>.
  68  *
  69  * @author Josh Bloch
  70  * @author Neal Gafter
  71  * @author John Rose
  72  * @since  1.2
  73  */
  74 public class Arrays {
  75 
  76     /**
  77      * The minimum array length below which a parallel sorting
  78      * algorithm will not further partition the sorting task. Using
  79      * smaller sizes typically results in memory contention across
  80      * tasks that makes parallel speedups unlikely.
  81      */
  82     private static final int MIN_ARRAY_SORT_GRAN = 1 << 13;
  83 
  84     // Suppresses default constructor, ensuring non-instantiability.
  85     private Arrays() {}
  86 


< prev index next >