|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sandev.basics.util.CSVTransforms
Converts an array of basic types to a comma separated value String.
Sample uses include simple UI displays or text reports. In at least some
of these cases, going through an XML representation in the process of
transforming is overkill, so this class covers the point-to-point
conversion. This only works for basic types, not hierarchical data.
CSV output in this case means a value, then a comma, then a space,
then a value. CSV input does its best with what it gets. Numbers are
not quoted, Strings are surrounded in doublequotes using backslash
escape character notation for internal doublequotes and backslashes.
| Constructor Summary | |
CSVTransforms()
|
|
| Method Summary | |
static boolean[] |
booleanArray(java.lang.String val)
convert the CSV string to a boolean array |
static java.lang.String |
csvString(boolean[] bools)
convert the boolean array to a CSV string |
static java.lang.String |
csvString(double[] doubles)
convert the double array to a CSV string |
static java.lang.String |
csvString(int[] ints)
convert the int array to a CSV string |
static java.lang.String |
csvString(long[] longs)
convert the long array to a CSV string |
static java.lang.String |
csvString(java.lang.String[] strings)
convert the string array to a CSV string |
static double[] |
doubleArray(java.lang.String val)
convert the CSV string to a double array |
static int[] |
intArray(java.lang.String val)
convert the CSV string to an int array |
static long[] |
longArray(java.lang.String val)
convert the CSV string to a long array |
static java.lang.String[] |
stringArray(java.lang.String val)
convert the CSV string to an array of single Strings. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CSVTransforms()
| Method Detail |
public static java.lang.String csvString(boolean[] bools)
public static boolean[] booleanArray(java.lang.String val)
public static java.lang.String csvString(int[] ints)
public static int[] intArray(java.lang.String val)
public static java.lang.String csvString(long[] longs)
public static long[] longArray(java.lang.String val)
public static java.lang.String csvString(double[] doubles)
public static double[] doubleArray(java.lang.String val)
public static java.lang.String csvString(java.lang.String[] strings)
public static java.lang.String[] stringArray(java.lang.String val)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||