public class Shorts extends Object
| 构造器和说明 |
|---|
Shorts() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
contains(short[] array,
short value)
数组中是否包含元素
|
static int |
indexOf(short[] array,
short value)
返回数组中指定元素所在位置,未找到返回 -1
|
static boolean |
isEmpty(short[] array)
数组是否为空
|
static boolean |
isNotEmpty(short[] array)
数组是否为非空
|
static boolean |
isSorted(short[] array)
检查数组是否升序,即array[i] <= array[i+1],若传入空数组,则返回false
|
static boolean |
isSortedAsc(short[] array)
检查数组是否升序,即array[i] <= array[i+1],若传入空数组,则返回false
|
static boolean |
isSortedDesc(short[] array)
检查数组是否降序,即array[i] >= array[i+1],若传入空数组,则返回false
|
static short[] |
join(short[]... arrays)
将多个数组合并在一起
忽略null的数组 |
static int |
lastIndexOf(short[] array,
short value)
返回数组中指定元素所在最后的位置,未找到返回 -1
|
static short |
max(short... numberArray)
取最大值
|
static short |
min(short... numberArray)
取最小值
|
static short |
parse(String text,
int radix) |
static short |
parseBin(String text) |
static short |
parseHex(String text) |
static short |
parseOct(String text) |
static short[] |
remove(short[] array,
int index)
移除数组中对应位置的元素
copy from commons-lang |
static short[] |
removeElement(short[] array,
short element)
移除数组中指定的元素
只会移除匹配到的第一个元素 copy from commons-lang |
static short[] |
reverse(short[] array)
反转数组,会变更原数组
|
static short[] |
reverse(short[] array,
int startIndexInclusive,
int endIndexExclusive)
反转数组,会变更原数组
|
static short[] |
shuffle(short[] array)
打乱数组顺序,会变更原数组
|
static short[] |
shuffle(short[] array,
Random random)
打乱数组顺序,会变更原数组
|
static short[] |
sub(short[] array,
int start,
int end)
获取子数组
|
static short[] |
swap(short[] array,
int index1,
int index2)
交换数组中两个位置的值
|
static String |
toBinString(short num) |
static String |
toHexString(short num) |
static String |
toOctString(short num) |
static short[] |
unwrap(Short... values)
包装类数组转为原始类型数组
|
static Short[] |
wrap(short... values)
将原始类型数组包装为包装类型
|
public static String toBinString(short num)
public static String toOctString(short num)
public static String toHexString(short num)
public static short parseBin(String text)
public static short parseOct(String text)
public static short parseHex(String text)
public static short parse(String text, int radix)
public static short[] join(short[]... arrays)
arrays - 数组集合public static Short[] wrap(short... values)
values - 原始类型数组public static short[] unwrap(Short... values)
values - 包装类型数组public static short[] sub(short[] array,
int start,
int end)
array - 数组start - 开始位置(包括)end - 结束位置(不包括)Arrays.copyOfRange(Object[], int, int)public static short[] remove(short[] array,
int index)
throws IllegalArgumentException
array - 数组对象,可以是对象数组,也可以原始类型数组index - 位置,如果位置小于0或者大于长度,返回原数组IllegalArgumentException - 参数对象不为数组对象public static short[] removeElement(short[] array,
short element)
throws IllegalArgumentException
array - 数组对象,可以是对象数组,也可以原始类型数组element - 要移除的元素IllegalArgumentException - 参数对象不为数组对象public static short[] reverse(short[] array,
int startIndexInclusive,
int endIndexExclusive)
array - 数组,会变更startIndexInclusive - 起始位置(包含)endIndexExclusive - 结束位置(不包含)public static short[] reverse(short[] array)
array - 数组,会变更public static short min(short... numberArray)
numberArray - 数字数组public static short max(short... numberArray)
numberArray - 数字数组public static short[] shuffle(short[] array)
array - 数组,会变更public static short[] shuffle(short[] array,
Random random)
array - 数组,会变更random - 随机数生成器public static short[] swap(short[] array,
int index1,
int index2)
array - 数组index1 - 位置1index2 - 位置2public static int indexOf(short[] array,
short value)
array - 数组value - 被检查的元素public static int lastIndexOf(short[] array,
short value)
array - 数组value - 被检查的元素public static boolean contains(short[] array,
short value)
array - 数组value - 被检查的元素public static boolean isSorted(short[] array)
array - 数组public static boolean isSortedAsc(short[] array)
array - 数组public static boolean isSortedDesc(short[] array)
array - 数组public static boolean isEmpty(short[] array)
array - 数组public static boolean isNotEmpty(short[] array)
array - 数组Copyright © 2024 fossc. All rights reserved.