Methods Summary |
---|
public static java.lang.String | concat(java.lang.String[] data)
String retVal = "";
for (int i=0;i < data.length && data[i] != null ;i++)
retVal = retVal + i + "\"" + PersistString.padQuotes(data[i])+ "\"" ;
return retVal;
|
static java.lang.String | padQuotes(java.lang.String data)
int index = 0 ;
int oldIndex = 0;
while (index >= 0) {
index = data.indexOf('\"",oldIndex);
if (index > 0) {
data = data.substring(0,index) + "\"" + data.substring(index );
//System.out.println ("Found a quote in the data " + data);
oldIndex = index + 2;
}
}
return data;
|
public static java.lang.String[] | parse(java.lang.String infoData)
Vector output = new Vector(10);
StringReader stream = new StringReader(infoData);
//StringBufferInputStream stream = new StringBufferInputStream(infoData);
//StreamTokenizer st = new StreamTokenizer(new BufferedInputStream(stream, 1000));
StreamTokenizer st = new StreamTokenizer(stream);
try {
st.nextToken();
while(true) {
String data = null;
while (st.nextToken() == '"") {
if (data == null)
data = st.sval;
else
data = data + "\"" + st.sval;
}
output.addElement(data);
if (st.ttype == StreamTokenizer.TT_EOF)
break;
}
}
catch (Exception e) {
System.out.println("PersistStream error " + e);
}
String [] outputArray = new String [output.size()];
for (int i=0;i<output.size();i++)
outputArray[i] = (String) output.elementAt(i);
return outputArray;
|