|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.javatest.util.StringArray
public class StringArray
A class to convert to and from a single string with space separated substrings.
Constructor Summary | |
---|---|
StringArray()
|
Method Summary | |
---|---|
static boolean |
contains(java.lang.String[] list,
java.lang.String target)
Does the string array contain the target string? Since the list is assumed to have no particular structure, the performance of this search is O(n). |
static boolean |
contains(java.lang.String list,
java.lang.String target)
Does the list contain the target string? This method is string parsing intensive, use with caution. |
static java.lang.String |
join(java.lang.String[] ss)
Converts an array of strings into a single space separated string. |
static java.lang.String |
join(java.lang.String[] ss,
java.lang.String sep)
Converts an array of strings into a single string, * using a specified separator. |
static java.lang.String[] |
split(java.lang.String s)
Convert a single whitespace separated string into it's component substrings. |
static java.lang.String[] |
splitList(java.lang.String list,
java.lang.String delim)
Split up a comma separated list of values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringArray()
Method Detail |
---|
public static java.lang.String[] split(java.lang.String s)
s
- The string to break apart. A null string will not
cause an error.
public static java.lang.String join(java.lang.String[] ss)
ss
- The strings which should be concatenated together. A zero
length or null value will not cause an error.
public static java.lang.String join(java.lang.String[] ss, java.lang.String sep)
ss
- The strings which should be concatenated together. A zero
length or null value will not cause an error.sep
- The separator to place between the elements of the string
array in the concatenated result
public static java.lang.String[] splitList(java.lang.String list, java.lang.String delim)
list
- The string to parse for items. Null or zero
length strings ok.delim
- The string which separates items in the list.
Must be non-null and have a length greater than
zero.
public static boolean contains(java.lang.String[] list, java.lang.String target)
list
- The list of strings to search, null is ok.
public static boolean contains(java.lang.String list, java.lang.String target)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |