|
Cytoscape 2.8.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.cli.Parser org.apache.commons.cli.PosixParser
public class PosixParser
The class PosixParser provides an implementation of the
flatten
method.
Parser
Constructor Summary | |
---|---|
PosixParser()
|
Method Summary | |
---|---|
protected void |
burstToken(String token,
boolean stopAtNonOption)
Breaks token into its constituent parts
using the following algorithm. |
protected String[] |
flatten(Options options,
String[] arguments,
boolean stopAtNonOption)
An implementation of Parser 's abstract
flatten method. |
Methods inherited from class org.apache.commons.cli.Parser |
---|
parse, parse, parse, parse, processArgs |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PosixParser()
Method Detail |
---|
protected String[] flatten(Options options, String[] arguments, boolean stopAtNonOption)
An implementation of Parser
's abstract
flatten
method.
The following are the rules used by this flatten method.
stopAtNonOption
is true then do not
burst anymore of arguments
entries, just add each
successive entry without further processing. Otherwise, ignore
stopAtNonOption
.arguments
entry is "--"
just add the entry to the list of processed tokensarguments
entry is "-"
just add the entry to the list of processed tokensarguments
entry is two characters
in length and the first character is "-" then check if this
is a valid Option
id. If it is a valid id, then add the
entry to the list of processed tokens and set the current Option
member. If it is not a valid id and stopAtNonOption
is true, then the remaining entries are copied to the list of
processed tokens. Otherwise, the current entry is ignored.arguments
entry is more than two
characters in length and the first character is "-" then
we need to burst the entry to determine its constituents. For more
information on the bursting algorithm see
burstToken
.arguments
entry is not handled
by any of the previous rules, then the entry is added to the list
of processed tokens.
flatten
in class Parser
options
- The command line Options
arguments
- The command line arguments to be parsedstopAtNonOption
- Specifies whether to stop flattening
when an non option is found.
arguments
String array.protected void burstToken(String token, boolean stopAtNonOption)
Breaks token
into its constituent parts
using the following algorithm.
Option
exists with that id.Option
does exist then add that character
prepended with "-" to the list of processed tokens.Option
can have an argument value and there
are remaining characters in the token then add the remaining
characters as a token to the list of processed tokens.Option
does NOT exist AND
stopAtNonOption
IS set then add the special token
"--" followed by the remaining characters and also
the remaining tokens directly to the processed tokens list.Option
does NOT exist AND
stopAtNonOption
IS NOT set then add that
character prepended with "-".
token
- The current token to be burststopAtNonOption
- Specifies whether to stop processing
at the first non-Option encountered.
|
Cytoscape 2.8.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |