数组工具

public class ArrayUtil
extends Object

java.lang.Object
com.android.tradefed.util.ArrayUtil


数组的实用方法

概括

公共方法

static String[] buildArray (String... arrays)

根据提供的内容构建一个数组。

static String join (String sep, Object... pieces)

将一系列对象转换为字符串,以sep分隔。

static <T> list (T... inputAry)

将可变参数列表/数组转换为ERROR(/List)

公共方法

构建数组

public static String[] buildArray (String... arrays)

根据提供的内容构建一个数组。

生成的数组将是arrays输入数组按原始顺序串联而成的。

参数
arrays String :要连接的数组

退货
String[]新构造的数组

加入

public static String join (String sep, 
                Object... pieces)

将一系列对象转换为字符串,以sep分隔。如果传递单个Collection ,则假定要连接该 Collection 的元素。否则,将传递的Object包装在ERROR(/List)中并加入生成的列表。

参数
sep String :用于分隔不同输出段的字符串分隔符。

pieces ObjectERROR(/Collection)或 varargs 对象Array

退货
String

列表

public static  list (T... inputAry)

将可变参数列表/数组转换为ERROR(/List) 。这对于手动构建ERROR(/List)实例很有用。请注意,这与Arrays.asList(T)不同,因为返回的数组是可变的。

参数
inputAry T :数组或可变参数列表

退货
具有相同内容的ERROR(/List)实例