|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.ide.util.DelimitedStrings
Delimited strings can be very useful for storing text, numeric and date values in a recoverable way for a readable file. A format supported by most databases and spreadsheets, it is based around a set of simple rules for parsing and constructing these strings.
[one,two,three,four,seventy-nine]
[yellow,green,"light blue",white,"dark red"]
" -> ""
["""please_keep_the_quotes""","please,_keep_the_comma"]
If the text qualifier is given as null, it is trusted that no whitespace needs preserving from values and that the field separator does not occur in data (as no special delimiting rules will apply).
Constructor Summary | |
DelimitedStrings(char delimiter,
char qualifier)
Construct a new DelimitedStrings object for the purpose of parsing and formatting strings (using the given delimiter and qualifier). |
|
DelimitedStrings(java.lang.String delimiters,
java.lang.Character qualifier)
Construct a new DelimitedStrings object for the purpose of parsing and formatting strings. |
Method Summary | |
java.lang.String |
format(java.lang.String[] values)
Format the given array of values into a delimited String, according to the indicated delimiter style. |
static DelimitedStrings |
getCommaSeparatedInstance()
Retrieve a delimited strings parser / formatter suitable for dealing with comma-separated value strings, a popular style. |
static DelimitedStrings |
getTabSeparatedInstance()
Retrieve a delimited strings parser / formatter suitable for dealing with tab delimited value strings, a popular style. |
java.lang.String[] |
parse(java.lang.String values)
Parse the given String of delimited values into an array, according to the indicated delimiter style. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DelimitedStrings(char delimiter, char qualifier)
qualifier
- text qualifier to use in the parsingpublic DelimitedStrings(java.lang.String delimiters, java.lang.Character qualifier)
delimiters
- field separators to use in the parsing (must be non-null
and contain a character).qualifier
- text qualifier to use in the parsing, or no text
qualifier if null.Method Detail |
public final java.lang.String[] parse(java.lang.String values)
values
- the delimited value String.
public final java.lang.String format(java.lang.String[] values)
values
- an array containing String values.
public static final DelimitedStrings getCommaSeparatedInstance()
public static final DelimitedStrings getTabSeparatedInstance()
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.