类 ArrayUtil
java.lang.Object
com.weicoder.common.util.ArrayUtil
- 直接已知子类:
U.A
数组帮助类
- 作者:
- WD
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static <E> E[]add(E[] one, int onePos, int oneLength, E[] two, int twoPos, int twoLength) 数组相加static <E> E[]add(E[] one, E[] two) 数组相加static <E> E[]add(E[] one, E[] two, int twoLength) 数组相加static Object根据传入的字符串转换成字符数组static Object根据传入的字符串转换成字符数组static <E> voidcopy(E[] src, int srcPos, E[] dest, int destPos, int length) 拷贝数组static <E> voidcopy(E[] src, E[] dest) 拷贝数组 已dest长度为准static <E> voidcopy(E[] src, E[] dest, int pos) 拷贝数组 已dest长度为准static <E> E[]getArray(E... e) 获得数组static <E> E[]获得数据static boolean判断是否数组static int[]把Integer数组转换成int数组static Integer[]toInteger(int[] n) 把int数组包装成Integer数组static Integer[]把String数组包装成Integer数组static <E> List<E>toList(E... e) 把数组转换成列表static String把数组对象转换成字符串static String[]把数组对象转换成字符串static String[]toStringArray(Integer[] n) 把Integer数组转换成String数组static String[]toStringArray(Object[] a) 把数组对象转换成字符串
-
构造器详细资料
-
ArrayUtil
public ArrayUtil()
-
-
方法详细资料
-
array
根据传入的字符串转换成字符数组- 参数:
s- 字符串c- 要转换的类型- 返回:
- 字符数组
-
array
根据传入的字符串转换成字符数组- 参数:
s- 字符串sepa- 分隔符c- 要转换的类型- 返回:
- 字符数组
-
isArray
判断是否数组- 参数:
obj- 对象- 返回:
- 是否数组
-
toList
把数组转换成列表- 类型参数:
E- 泛型- 参数:
e- 元素数组- 返回:
- 元素列表
-
copy
public static <E> void copy(E[] src, E[] dest) 拷贝数组 已dest长度为准- 类型参数:
E- 泛型- 参数:
src- 原数组dest- 目标数组
-
copy
public static <E> void copy(E[] src, E[] dest, int pos) 拷贝数组 已dest长度为准- 类型参数:
E- 泛型- 参数:
src- 原数组dest- 目标数组pos- 从第几位开始
-
copy
public static <E> void copy(E[] src, int srcPos, E[] dest, int destPos, int length) 拷贝数组- 类型参数:
E- 泛型- 参数:
src- 原数组srcPos- 从原数组第几位开始dest- 目标数组destPos- 从目标组第几位开始length- 拷贝长度
-
toInteger
把int数组包装成Integer数组- 参数:
n- int数组- 返回:
- Integer数组
-
toInteger
把String数组包装成Integer数组- 参数:
s- String数组- 返回:
- Integer数组
-
toInt
把Integer数组转换成int数组- 参数:
n- Integer数组- 返回:
- int数组
-
toStringArray
把Integer数组转换成String数组- 参数:
n- Integer数组- 返回:
- String数组
-
toStringArray
把数组对象转换成字符串- 参数:
a- 对象数组- 返回:
- 字符串
-
toStringArray
把数组对象转换成字符串- 参数:
a- 对象数组- 返回:
- 字符串
-
toString
把数组对象转换成字符串- 参数:
a- 对象数组- 返回:
- 字符串
-
add
public static <E> E[] add(E[] one, E[] two) 数组相加- 类型参数:
E- 泛型- 参数:
one- 第一个数组因数two- 第二个数组因数- 返回:
- 相加后的数组
-
add
public static <E> E[] add(E[] one, E[] two, int twoLength) 数组相加- 类型参数:
E- 泛型- 参数:
one- 第一个数组因数two- 第二个数组因数twoLength- 第二个数组长度 一共相加多少长度- 返回:
- 相加后的数组
-
add
public static <E> E[] add(E[] one, int onePos, int oneLength, E[] two, int twoPos, int twoLength) 数组相加- 类型参数:
E- 泛型- 参数:
one- 第一个数组因数onePos- 第一个数组偏移 从第几个元素开始oneLength- 第一个数组长度 一共相加多少长度two- 第二个数组因数twoPos- 第二个数组偏移 从第几个元素开始twoLength- 第二个数组长度 一共相加多少长度- 返回:
- 相加后的数组
-
getArray
获得数据- 类型参数:
E- 泛型- 参数:
clazz- 数组类型length- 数组长度- 返回:
- 数组
-
getArray
获得数组- 类型参数:
E- 泛型- 参数:
e- 要组成数据的参数- 返回:
- e数组
-