com.faunos.util.main
Class Arguments

java.lang.Object
  extended by com.faunos.util.main.Arguments

public class Arguments
extends Object

Support for parsing command line arguments.

Author:
Babak Farhang

Constructor Summary
Arguments()
          Default constructor.
Arguments(Collection<String> identifiers)
          Creates a new instance with the specified option identifiers.
Arguments(Options options)
          Creates a new instance with the given Options.
 
Method Summary
 void addToken(String token)
          Adds the given command line token.
 List<String> getArgumentList()
          Returns the argument tokens supplied from the command line that were not interpreted as options.
 List<String> getOptionList()
          Returns the list of options supplied from the command line.
 Options getOptions()
          Returns the Options configured for this instance.
 void parse(String[] args)
          Parses the given command line tokens and populates the option- and argument- lists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Arguments

public Arguments()
Default constructor. Creates a new instance with empty options.

See Also:
getOptions()

Arguments

public Arguments(Options options)
Creates a new instance with the given Options.

See Also:
getOptions()

Arguments

public Arguments(Collection<String> identifiers)
Creates a new instance with the specified option identifiers.

See Also:
getOptions()
Method Detail

getOptionList

public List<String> getOptionList()
Returns the list of options supplied from the command line. The list is collected from invocations of parse(String[]) or addToken(String)


getOptions

public Options getOptions()
Returns the Options configured for this instance.


getArgumentList

public List<String> getArgumentList()
Returns the argument tokens supplied from the command line that were not interpreted as options. The list is collected from invocations of parse(String[]) or addToken(String)


addToken

public void addToken(String token)
Adds the given command line token. If the token starts with '--', then the token is interpreted as a single option; if the token starts with a single '-', then the token is interpreted as sequence of one-character options; o.w. the token is interpreted as a regular argument.


parse

public void parse(String[] args)
Parses the given command line tokens and populates the option- and argument- lists.



SourceForge.net Logo