Modifier and Type | Method and Description |
---|---|
static void |
sort(boolean[] a)
Sorts the given array so that all the
false values are at the
beginning. |
static void |
sort(boolean[] a,
BooleanComparator c)
Sorts the given array by the given comparator.
|
static void |
sort(boolean[] a,
int fromIndex,
int toIndex)
Sorts the indicated portion of the given array so that all the
false values are at the beginning. |
static void |
sort(boolean[] a,
int fromIndex,
int toIndex,
BooleanComparator c)
Sorts the indicated portion of the given array by the given comparator.
|
static void |
sort(byte[] a,
ByteComparator c)
Sorts the given array by the given comparator.
|
static void |
sort(byte[] a,
ByteComparator c,
boolean stable)
Sorts the given array by the given comparator.
|
static void |
sort(byte[] a,
int fromIndex,
int toIndex,
ByteComparator c)
Sorts the indicated portion of the given array by the given comparator.
|
static void |
sort(byte[] a,
int fromIndex,
int toIndex,
ByteComparator c,
boolean stable)
Sorts the indicated porition of the given array by the given comparator.
|
static void |
sort(char[] a,
CharComparator c)
Sorts the given array by the given comparator.
|
static void |
sort(char[] a,
CharComparator c,
boolean stable)
Sorts the given array by the given comparator.
|
static void |
sort(char[] a,
int fromIndex,
int toIndex,
CharComparator c)
Sorts the indicated portion of the given array by the given comparator.
|
static void |
sort(char[] a,
int fromIndex,
int toIndex,
CharComparator c,
boolean stable)
Sorts the indicated porition of the given array by the given comparator.
|
static void |
sort(double[] a,
DoubleComparator c)
Sorts the given array by the given comparator.
|
static void |
sort(double[] a,
DoubleComparator c,
boolean stable)
Sorts the given array by the given comparator.
|
static void |
sort(double[] a,
int fromIndex,
int toIndex,
DoubleComparator c)
Sorts the indicated portion of the given array by the given comparator.
|
static void |
sort(double[] a,
int fromIndex,
int toIndex,
DoubleComparator c,
boolean stable)
Sorts the indicated porition of the given array by the given comparator.
|
static void |
sort(float[] a,
FloatComparator c)
Sorts the given array by the given comparator.
|
static void |
sort(float[] a,
FloatComparator c,
boolean stable)
Sorts the given array by the given comparator.
|
static void |
sort(float[] a,
int fromIndex,
int toIndex,
FloatComparator c)
Sorts the indicated portion of the given array by the given comparator.
|
static void |
sort(float[] a,
int fromIndex,
int toIndex,
FloatComparator c,
boolean stable)
Sorts the indicated porition of the given array by the given comparator.
|
static void |
sort(int[] a,
IntComparator c)
Sorts the given array by the given comparator.
|
static void |
sort(int[] a,
IntComparator c,
boolean stable)
Sorts the given array by the given comparator.
|
static void |
sort(int[] a,
int fromIndex,
int toIndex,
IntComparator c)
Sorts the indicated portion of the given array by the given comparator.
|
static void |
sort(int[] a,
int fromIndex,
int toIndex,
IntComparator c,
boolean stable)
Sorts the indicated porition of the given array by the given comparator.
|
static void |
sort(long[] a,
int fromIndex,
int toIndex,
LongComparator c)
Sorts the indicated portion of the given array by the given comparator.
|
static void |
sort(long[] a,
int fromIndex,
int toIndex,
LongComparator c,
boolean stable)
Sorts the indicated porition of the given array by the given comparator.
|
static void |
sort(long[] a,
LongComparator c)
Sorts the given array by the given comparator.
|
static void |
sort(long[] a,
LongComparator c,
boolean stable)
Sorts the given array by the given comparator.
|
static void |
sort(short[] a,
int fromIndex,
int toIndex,
ShortComparator c)
Sorts the indicated portion of the given array by the given comparator.
|
static void |
sort(short[] a,
int fromIndex,
int toIndex,
ShortComparator c,
boolean stable)
Sorts the indicated porition of the given array by the given comparator.
|
static void |
sort(short[] a,
ShortComparator c)
Sorts the given array by the given comparator.
|
static void |
sort(short[] a,
ShortComparator c,
boolean stable)
Sorts the given array by the given comparator.
|
public static void sort(boolean[] a)
false
values are at the
beginning.a
- the array to sortNullPointerException
- if a == null
public static void sort(boolean[] a, int fromIndex, int toIndex)
false
values are at the beginning.a
- the array to sortfromIndex
- the index (inclusive) marking the beginning of the array
portiontoIndex
- the index (exclusive) marking the end of the array portionNullPointerException
- if a == null
ArrayIndexOutOfBoundsException
- if fromIndex < 0
or
toIndex > a.length
IllegalArgumentException
- if fromIndex > toIndex
public static void sort(boolean[] a, BooleanComparator c)
a
- the array to sortc
- the comparator to use for sorting the array, or null
for
natural orderingNullPointerException
- if a == null
IllegalArgumentException
- if sorting finds that c
violates
the BooleanComparator
contractpublic static void sort(boolean[] a, int fromIndex, int toIndex, BooleanComparator c)
a
- the array to sortfromIndex
- the index (inclusive) marking the beginning of the array
portiontoIndex
- the index (exclusive) marking the end of the array portionc
- the comparator to use for sorting the array, or null
for
natural orderingNullPointerException
- if a == null
ArrayIndexOutOfBoundsException
- if fromIndex < 0
or
toIndex > a.length
IllegalArgumentException
- if fromIndex > toIndex
or
sorting finds that c
violates the BooleanComparator
contractpublic static void sort(byte[] a, ByteComparator c)
For uses that don't care about a stable sort, especially when the data
has no underlying patterns (that is, completely unsorted, random data),
the non-stable version of this method may be up to twice as fast. Use
sort(byte[], ByteComparator, boolean)
, with stable
set to
false
.
a
- the array to sortc
- the comparator to use for sorting the array, or null
for
natural orderingNullPointerException
- if a == null
IllegalArgumentException
- if sorting finds that c
violates
the ByteComparator
contractpublic static void sort(byte[] a, int fromIndex, int toIndex, ByteComparator c)
For uses that don't care about a stable sort, especially when the data
has no underlying patterns (that is, completely unsorted, random data),
the non-stable version of this method may be up to twice as fast. Use
sort(byte[], int, int, ByteComparator, boolean)
, with stable
set to false
.
a
- the array to sortfromIndex
- the index (inclusive) marking the beginning of the array
portiontoIndex
- the index (exclusive) marking the end of the array portionc
- the comparator to use for sorting the array, or null
for
natural orderingNullPointerException
- if a == null
ArrayIndexOutOfBoundsException
- if fromIndex < 0
or
toIndex > a.length
IllegalArgumentException
- if fromIndex > toIndex
or
sorting finds that c
violates the ByteComparator
contractpublic static void sort(byte[] a, ByteComparator c, boolean stable)
stable
is
true
, the sorting algorithm will result in a stable sort, so two
items that compare to 0 will be kept in the same order when the sort is
complete. When false
, no such guarantees are made, but the sort
may be up to twice as fast, especially for unpatterned data.a
- the array to sortc
- the comparator to use for sorting the array, or null
for
natural orderingstable
- whether to use a slower, but stable, sorting algorithmNullPointerException
- if a == null
IllegalArgumentException
- if sorting finds that c
violates
the ByteComparator
contractpublic static void sort(byte[] a, int fromIndex, int toIndex, ByteComparator c, boolean stable)
stable
is true
, the sorting algorithm will result in
a stable sort, so two items that compare to 0 will be kept in the same
order when the sort is complete. When false
, no such guarantees
are made, but the sort may be up to twice as fast, especially for
unpatterned data.a
- the array to sortfromIndex
- the index (inclusive) marking the beginning of the array
portiontoIndex
- the index (exclusive) marking the end of the array portionc
- the comparator to use for sorting the array, or null
for
natural orderingstable
- whether to use a slower, but stable, sorting algorithmNullPointerException
- if a == null
ArrayIndexOutOfBoundsException
- if fromIndex < 0
or
toIndex > a.length
IllegalArgumentException
- if fromIndex > toIndex
or
sorting finds that c
violates the ByteComparator
contractpublic static void sort(char[] a, CharComparator c)
For uses that don't care about a stable sort, especially when the data
has no underlying patterns (that is, completely unsorted, random data),
the non-stable version of this method may be up to twice as fast. Use
sort(char[], CharComparator, boolean)
, with stable
set to
false
.
a
- the array to sortc
- the comparator to use for sorting the array, or null
for
natural orderingNullPointerException
- if a == null
IllegalArgumentException
- if sorting finds that c
violates
the CharComparator
contractpublic static void sort(char[] a, int fromIndex, int toIndex, CharComparator c)
For uses that don't care about a stable sort, especially when the data
has no underlying patterns (that is, completely unsorted, random data),
the non-stable version of this method may be up to twice as fast. Use
sort(char[], int, int, CharComparator, boolean)
, with stable
set to false
.
a
- the array to sortfromIndex
- the index (inclusive) marking the beginning of the array
portiontoIndex
- the index (exclusive) marking the end of the array portionc
- the comparator to use for sorting the array, or null
for
natural orderingNullPointerException
- if a == null
ArrayIndexOutOfBoundsException
- if fromIndex < 0
or
toIndex > a.length
IllegalArgumentException
- if fromIndex > toIndex
or
sorting finds that c
violates the CharComparator
contractpublic static void sort(char[] a, CharComparator c, boolean stable)
stable
is
true
, the sorting algorithm will result in a stable sort, so two
items that compare to 0 will be kept in the same order when the sort is
complete. When false
, no such guarantees are made, but the sort
may be up to twice as fast, especially for unpatterned data.a
- the array to sortc
- the comparator to use for sorting the array, or null
for
natural orderingstable
- whether to use a slower, but stable, sorting algorithmNullPointerException
- if a == null
IllegalArgumentException
- if sorting finds that c
violates
the CharComparator
contractpublic static void sort(char[] a, int fromIndex, int toIndex, CharComparator c, boolean stable)
stable
is true
, the sorting algorithm will result in
a stable sort, so two items that compare to 0 will be kept in the same
order when the sort is complete. When false
, no such guarantees
are made, but the sort may be up to twice as fast, especially for
unpatterned data.a
- the array to sortfromIndex
- the index (inclusive) marking the beginning of the array
portiontoIndex
- the index (exclusive) marking the end of the array portionc
- the comparator to use for sorting the array, or null
for
natural orderingstable
- whether to use a slower, but stable, sorting algorithmNullPointerException
- if a == null
ArrayIndexOutOfBoundsException
- if fromIndex < 0
or
toIndex > a.length
IllegalArgumentException
- if fromIndex > toIndex
or
sorting finds that c
violates the CharComparator
contractpublic static void sort(double[] a, DoubleComparator c)
For uses that don't care about a stable sort, especially when the data
has no underlying patterns (that is, completely unsorted, random data),
the non-stable version of this method may be up to twice as fast. Use
sort(double[], DoubleComparator, boolean)
, with stable
set to
false
.
a
- the array to sortc
- the comparator to use for sorting the array, or null
for
natural orderingNullPointerException
- if a == null
IllegalArgumentException
- if sorting finds that c
violates
the DoubleComparator
contractpublic static void sort(double[] a, int fromIndex, int toIndex, DoubleComparator c)
For uses that don't care about a stable sort, especially when the data
has no underlying patterns (that is, completely unsorted, random data),
the non-stable version of this method may be up to twice as fast. Use
sort(double[], int, int, DoubleComparator, boolean)
, with stable
set to false
.
a
- the array to sortfromIndex
- the index (inclusive) marking the beginning of the array
portiontoIndex
- the index (exclusive) marking the end of the array portionc
- the comparator to use for sorting the array, or null
for
natural orderingNullPointerException
- if a == null
ArrayIndexOutOfBoundsException
- if fromIndex < 0
or
toIndex > a.length
IllegalArgumentException
- if fromIndex > toIndex
or
sorting finds that c
violates the DoubleComparator
contractpublic static void sort(double[] a, DoubleComparator c, boolean stable)
stable
is
true
, the sorting algorithm will result in a stable sort, so two
items that compare to 0 will be kept in the same order when the sort is
complete. When false
, no such guarantees are made, but the sort
may be up to twice as fast, especially for unpatterned data.a
- the array to sortc
- the comparator to use for sorting the array, or null
for
natural orderingstable
- whether to use a slower, but stable, sorting algorithmNullPointerException
- if a == null
IllegalArgumentException
- if sorting finds that c
violates
the DoubleComparator
contractpublic static void sort(double[] a, int fromIndex, int toIndex, DoubleComparator c, boolean stable)
stable
is true
, the sorting algorithm will result in
a stable sort, so two items that compare to 0 will be kept in the same
order when the sort is complete. When false
, no such guarantees
are made, but the sort may be up to twice as fast, especially for
unpatterned data.a
- the array to sortfromIndex
- the index (inclusive) marking the beginning of the array
portiontoIndex
- the index (exclusive) marking the end of the array portionc
- the comparator to use for sorting the array, or null
for
natural orderingstable
- whether to use a slower, but stable, sorting algorithmNullPointerException
- if a == null
ArrayIndexOutOfBoundsException
- if fromIndex < 0
or
toIndex > a.length
IllegalArgumentException
- if fromIndex > toIndex
or
sorting finds that c
violates the DoubleComparator
contractpublic static void sort(float[] a, FloatComparator c)
For uses that don't care about a stable sort, especially when the data
has no underlying patterns (that is, completely unsorted, random data),
the non-stable version of this method may be up to twice as fast. Use
sort(float[], FloatComparator, boolean)
, with stable
set to
false
.
a
- the array to sortc
- the comparator to use for sorting the array, or null
for
natural orderingNullPointerException
- if a == null
IllegalArgumentException
- if sorting finds that c
violates
the FloatComparator
contractpublic static void sort(float[] a, int fromIndex, int toIndex, FloatComparator c)
For uses that don't care about a stable sort, especially when the data
has no underlying patterns (that is, completely unsorted, random data),
the non-stable version of this method may be up to twice as fast. Use
sort(float[], int, int, FloatComparator, boolean)
, with stable
set to false
.
a
- the array to sortfromIndex
- the index (inclusive) marking the beginning of the array
portiontoIndex
- the index (exclusive) marking the end of the array portionc
- the comparator to use for sorting the array, or null
for
natural orderingNullPointerException
- if a == null
ArrayIndexOutOfBoundsException
- if fromIndex < 0
or
toIndex > a.length
IllegalArgumentException
- if fromIndex > toIndex
or
sorting finds that c
violates the FloatComparator
contractpublic static void sort(float[] a, FloatComparator c, boolean stable)
stable
is
true
, the sorting algorithm will result in a stable sort, so two
items that compare to 0 will be kept in the same order when the sort is
complete. When false
, no such guarantees are made, but the sort
may be up to twice as fast, especially for unpatterned data.a
- the array to sortc
- the comparator to use for sorting the array, or null
for
natural orderingstable
- whether to use a slower, but stable, sorting algorithmNullPointerException
- if a == null
IllegalArgumentException
- if sorting finds that c
violates
the FloatComparator
contractpublic static void sort(float[] a, int fromIndex, int toIndex, FloatComparator c, boolean stable)
stable
is true
, the sorting algorithm will result in
a stable sort, so two items that compare to 0 will be kept in the same
order when the sort is complete. When false
, no such guarantees
are made, but the sort may be up to twice as fast, especially for
unpatterned data.a
- the array to sortfromIndex
- the index (inclusive) marking the beginning of the array
portiontoIndex
- the index (exclusive) marking the end of the array portionc
- the comparator to use for sorting the array, or null
for
natural orderingstable
- whether to use a slower, but stable, sorting algorithmNullPointerException
- if a == null
ArrayIndexOutOfBoundsException
- if fromIndex < 0
or
toIndex > a.length
IllegalArgumentException
- if fromIndex > toIndex
or
sorting finds that c
violates the FloatComparator
contractpublic static void sort(int[] a, IntComparator c)
For uses that don't care about a stable sort, especially when the data
has no underlying patterns (that is, completely unsorted, random data),
the non-stable version of this method may be up to twice as fast. Use
sort(int[], IntComparator, boolean)
, with stable
set to
false
.
a
- the array to sortc
- the comparator to use for sorting the array, or null
for
natural orderingNullPointerException
- if a == null
IllegalArgumentException
- if sorting finds that c
violates
the IntComparator
contractpublic static void sort(int[] a, int fromIndex, int toIndex, IntComparator c)
For uses that don't care about a stable sort, especially when the data
has no underlying patterns (that is, completely unsorted, random data),
the non-stable version of this method may be up to twice as fast. Use
sort(int[], int, int, IntComparator, boolean)
, with stable
set to false
.
a
- the array to sortfromIndex
- the index (inclusive) marking the beginning of the array
portiontoIndex
- the index (exclusive) marking the end of the array portionc
- the comparator to use for sorting the array, or null
for
natural orderingNullPointerException
- if a == null
ArrayIndexOutOfBoundsException
- if fromIndex < 0
or
toIndex > a.length
IllegalArgumentException
- if fromIndex > toIndex
or
sorting finds that c
violates the IntComparator
contractpublic static void sort(int[] a, IntComparator c, boolean stable)
stable
is
true
, the sorting algorithm will result in a stable sort, so two
items that compare to 0 will be kept in the same order when the sort is
complete. When false
, no such guarantees are made, but the sort
may be up to twice as fast, especially for unpatterned data.a
- the array to sortc
- the comparator to use for sorting the array, or null
for
natural orderingstable
- whether to use a slower, but stable, sorting algorithmNullPointerException
- if a == null
IllegalArgumentException
- if sorting finds that c
violates
the IntComparator
contractpublic static void sort(int[] a, int fromIndex, int toIndex, IntComparator c, boolean stable)
stable
is true
, the sorting algorithm will result in
a stable sort, so two items that compare to 0 will be kept in the same
order when the sort is complete. When false
, no such guarantees
are made, but the sort may be up to twice as fast, especially for
unpatterned data.a
- the array to sortfromIndex
- the index (inclusive) marking the beginning of the array
portiontoIndex
- the index (exclusive) marking the end of the array portionc
- the comparator to use for sorting the array, or null
for
natural orderingstable
- whether to use a slower, but stable, sorting algorithmNullPointerException
- if a == null
ArrayIndexOutOfBoundsException
- if fromIndex < 0
or
toIndex > a.length
IllegalArgumentException
- if fromIndex > toIndex
or
sorting finds that c
violates the IntComparator
contractpublic static void sort(long[] a, LongComparator c)
For uses that don't care about a stable sort, especially when the data
has no underlying patterns (that is, completely unsorted, random data),
the non-stable version of this method may be up to twice as fast. Use
sort(long[], LongComparator, boolean)
, with stable
set to
false
.
a
- the array to sortc
- the comparator to use for sorting the array, or null
for
natural orderingNullPointerException
- if a == null
IllegalArgumentException
- if sorting finds that c
violates
the LongComparator
contractpublic static void sort(long[] a, int fromIndex, int toIndex, LongComparator c)
For uses that don't care about a stable sort, especially when the data
has no underlying patterns (that is, completely unsorted, random data),
the non-stable version of this method may be up to twice as fast. Use
sort(long[], int, int, LongComparator, boolean)
, with stable
set to false
.
a
- the array to sortfromIndex
- the index (inclusive) marking the beginning of the array
portiontoIndex
- the index (exclusive) marking the end of the array portionc
- the comparator to use for sorting the array, or null
for
natural orderingNullPointerException
- if a == null
ArrayIndexOutOfBoundsException
- if fromIndex < 0
or
toIndex > a.length
IllegalArgumentException
- if fromIndex > toIndex
or
sorting finds that c
violates the LongComparator
contractpublic static void sort(long[] a, LongComparator c, boolean stable)
stable
is
true
, the sorting algorithm will result in a stable sort, so two
items that compare to 0 will be kept in the same order when the sort is
complete. When false
, no such guarantees are made, but the sort
may be up to twice as fast, especially for unpatterned data.a
- the array to sortc
- the comparator to use for sorting the array, or null
for
natural orderingstable
- whether to use a slower, but stable, sorting algorithmNullPointerException
- if a == null
IllegalArgumentException
- if sorting finds that c
violates
the LongComparator
contractpublic static void sort(long[] a, int fromIndex, int toIndex, LongComparator c, boolean stable)
stable
is true
, the sorting algorithm will result in
a stable sort, so two items that compare to 0 will be kept in the same
order when the sort is complete. When false
, no such guarantees
are made, but the sort may be up to twice as fast, especially for
unpatterned data.a
- the array to sortfromIndex
- the index (inclusive) marking the beginning of the array
portiontoIndex
- the index (exclusive) marking the end of the array portionc
- the comparator to use for sorting the array, or null
for
natural orderingstable
- whether to use a slower, but stable, sorting algorithmNullPointerException
- if a == null
ArrayIndexOutOfBoundsException
- if fromIndex < 0
or
toIndex > a.length
IllegalArgumentException
- if fromIndex > toIndex
or
sorting finds that c
violates the LongComparator
contractpublic static void sort(short[] a, ShortComparator c)
For uses that don't care about a stable sort, especially when the data
has no underlying patterns (that is, completely unsorted, random data),
the non-stable version of this method may be up to twice as fast. Use
sort(short[], ShortComparator, boolean)
, with stable
set to
false
.
a
- the array to sortc
- the comparator to use for sorting the array, or null
for
natural orderingNullPointerException
- if a == null
IllegalArgumentException
- if sorting finds that c
violates
the ShortComparator
contractpublic static void sort(short[] a, int fromIndex, int toIndex, ShortComparator c)
For uses that don't care about a stable sort, especially when the data
has no underlying patterns (that is, completely unsorted, random data),
the non-stable version of this method may be up to twice as fast. Use
sort(short[], int, int, ShortComparator, boolean)
, with stable
set to false
.
a
- the array to sortfromIndex
- the index (inclusive) marking the beginning of the array
portiontoIndex
- the index (exclusive) marking the end of the array portionc
- the comparator to use for sorting the array, or null
for
natural orderingNullPointerException
- if a == null
ArrayIndexOutOfBoundsException
- if fromIndex < 0
or
toIndex > a.length
IllegalArgumentException
- if fromIndex > toIndex
or
sorting finds that c
violates the ShortComparator
contractpublic static void sort(short[] a, ShortComparator c, boolean stable)
stable
is
true
, the sorting algorithm will result in a stable sort, so two
items that compare to 0 will be kept in the same order when the sort is
complete. When false
, no such guarantees are made, but the sort
may be up to twice as fast, especially for unpatterned data.a
- the array to sortc
- the comparator to use for sorting the array, or null
for
natural orderingstable
- whether to use a slower, but stable, sorting algorithmNullPointerException
- if a == null
IllegalArgumentException
- if sorting finds that c
violates
the ShortComparator
contractpublic static void sort(short[] a, int fromIndex, int toIndex, ShortComparator c, boolean stable)
stable
is true
, the sorting algorithm will result in
a stable sort, so two items that compare to 0 will be kept in the same
order when the sort is complete. When false
, no such guarantees
are made, but the sort may be up to twice as fast, especially for
unpatterned data.a
- the array to sortfromIndex
- the index (inclusive) marking the beginning of the array
portiontoIndex
- the index (exclusive) marking the end of the array portionc
- the comparator to use for sorting the array, or null
for
natural orderingstable
- whether to use a slower, but stable, sorting algorithmNullPointerException
- if a == null
ArrayIndexOutOfBoundsException
- if fromIndex < 0
or
toIndex > a.length
IllegalArgumentException
- if fromIndex > toIndex
or
sorting finds that c
violates the ShortComparator
contractCopyright © 2016. All rights reserved.