|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--pds.util.PPIOption
PPIOption is a class that contains methods for parsing options and finding values within those options. It includes support for parsing strings into binary values.
Nested Class Summary | |
(package private) static class |
PPIOption.Item
|
Field Summary | |
(package private) java.util.ArrayList |
mItemList
List of option names and id |
Constructor Summary | |
PPIOption()
Creates an instance. |
Method Summary | |
int |
add(java.lang.String name,
int id)
Adds an option definition to the list of known options. |
static java.lang.String |
find(java.lang.String[] options,
java.lang.String name,
java.lang.String defaultValue,
int start)
Searches a list contain options specified in a KEYWORD=VALUE format and locates the option with a given keyword. |
static double |
toDouble(java.lang.String value)
Converts a string to a double. |
static int |
toInt(java.lang.String value)
Converts a string to a int. |
int |
token(java.lang.String name)
Searches the list of options and returns the ID of the first match found. |
static pds.util.PPITime |
toTime(java.lang.String pattern,
java.lang.String value)
Converts a string to a PPITime. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
java.util.ArrayList mItemList
Constructor Detail |
public PPIOption()
Method Detail |
public int add(java.lang.String name, int id)
name
- the name of the option.
public int token(java.lang.String name)
name
- the name of the option.
-1
is returned.public static int toInt(java.lang.String value)
value
- a string representation of a value.
public static double toDouble(java.lang.String value)
value
- a string representation of a value.
public static pds.util.PPITime toTime(java.lang.String pattern, java.lang.String value)
pattern
- a string representation the pattern the value is
represented in.value
- a string representation of a value.
null
if there
was an error in parsing the value.public static java.lang.String find(java.lang.String[] options, java.lang.String name, java.lang.String defaultValue, int start)
options
- the array of options. Each options must be specified in
the form KEYWORD=VALUE. If an option is specified as just
KEYWORD, then a value of 1 is assumed.name
- the keyword to locate within the list of options.
Partial matches are permitted.defaultValue
- the default value to return if an options with the
the given keyword is not found.start
- the index of the element within options to begin the search.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |