|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectigpp.util.Option
public class Option
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.
Constructor Summary | |
---|---|
Option()
Creates an instance. |
Method Summary | |
---|---|
int |
add(String name)
Adds an option definition to the list of known options. |
int |
add(String name,
int id)
Adds an option definition to the list of known options. |
static String |
find(String[] options,
String name)
Searches a list contain options specified in a KEYWORD=VALUE format and locates the option with a given keyword. |
static String |
find(String[] options,
String name,
String defaultValue)
Searches a list contain options specified in a KEYWORD=VALUE format and locates the option with a given keyword. |
static String |
find(String[] options,
String name,
String defaultValue,
int start)
Searches a list contain options specified in a KEYWORD=VALUE format and locates the option with a given keyword. |
int |
token(String name)
Searches the list of options and returns the ID of the first match found. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Option()
Method Detail |
---|
public int add(String name, int id)
name
- the name of the option.id
- the integer ID of the option.
public int add(String name)
name
- the name of the option.
public int token(String name)
name
- the name of the option.
-1
is returned.public static String find(String[] options, String name)
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.
public static String find(String[] options, String name, String defaultValue)
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.
public static String find(String[] options, String name, 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 |