// 将String[]类型的数据转换成ArrayList类型
public static String[] getStrings(ArrayList arrayList)
{
String[] record = new String[arrayList.size()];
arrayList.toArray(record);
return record;
}
public static String[] getStrings(ArrayList arrayList)
{
String[] record = new String[arrayList.size()];
arrayList.toArray(record);
return record;
}
// 将String[]类型的数据转换成list类型
public ArrayList toArrayList(String[] productIDs)
{
ArrayList list = new ArrayList();
for (int i = 0; i < productIDs.length; i++)
{
if (!((null = productIDs[i]) || "".equals(productIDs[i])))
{
list.add(productIDs[i]);
}
}
return list;
}
public ArrayList toArrayList(String[] productIDs)
{
ArrayList list = new ArrayList();
for (int i = 0; i < productIDs.length; i++)
{
if (!((null = productIDs[i]) || "".equals(productIDs[i])))
{
list.add(productIDs[i]);
}
}
return list;
}
相关热门文章
给主人留下些什么吧!~~
评论热议