Methods Summary |
---|
public static void | main(java.lang.String[] args)
ArrayList L1 = new ArrayList();
ArrayList L2 = new ArrayList();
L1.add("Hello");//NOI18N
L1.add("World");//NOI18N
L1.add("!!!");//NOI18N
L2.add(Integer.valueOf(5));
L2.add(Integer.valueOf(7));
String ss[] = toStringArray(L1);
for(int i = 0; i < ss.length; i++)
//Bug 4677074 System.out.println("String #" + i + ": " + ss[i]);//NOI18N
//Bug 4677074 begin
_logger.log(Level.FINE,"String #" + i + ": " + ss[i]);
//Bug 4677074 end
// should throw
try
{
ss = toStringArray(L2);
}
catch(ArrayStoreException e)
{
//Bug 4677074 System.out.println("Caught an Exception, as expected: " + e);//NOI18N
//Bug 4677074 begin
_logger.log(Level.WARNING,"iplanet_util.arraystore_exception",e);
}
|
public static java.util.ArrayList | toArrayList(java.lang.String[] ss)
if(ss == null)
return new ArrayList();
ArrayList list = new ArrayList(ss.length);
for(int i = 0; i < ss.length; i++)
list.add(ss[i]);
return list;
|
public static java.lang.String | toOneString(java.lang.String[] ss)
String s = new String();
for(int i = 0; ss != null && i < ss.length; i++)
{
s += ss[i] + "\n";//NOI18N
}
return s;
|
public static java.lang.String[] | toStringArray(java.util.AbstractCollection coll)
//Bug 4677074 end
String ss[] = new String[0];
if(coll.size() > 0)
ss = (String[]) coll.toArray(ss);
return ss;
|