com.faunos.util.main
Class Options

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

public class Options
extends Object

Encapsulates command line tokens that are to be interpreted as options.

Author:
Babak Farhang

Constructor Summary
Options()
          Creates a new empty instance.
Options(Collection<String> identifiers)
          Creates a new instance with the given option identifiers.
 
Method Summary
 void add(char opt)
          Adds the specified single-character option after checking against and removing the option from the set of identifiers.
 void add(String opt)
          Adds the specified option after checking against and removing the option from the set of identifiers.
 Set<String> getIdentifiers()
          Returns a reference to the set of allowed option identifiers.
 List<String> getSubmitted()
          Returns the list of options submitted in the order they were received through the either of the add methods.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Options

public Options()
Creates a new empty instance.


Options

public Options(Collection<String> identifiers)
Creates a new instance with the given option identifiers. The identifiers define the allowable options.

Method Detail

getIdentifiers

public Set<String> getIdentifiers()
Returns a reference to the set of allowed option identifiers.


add

public void add(String opt)
Adds the specified option after checking against and removing the option from the set of identifiers. If the passed in option opt is not a member of the set of identifers, then a IllegalArgumentException is thrown.

See Also:
getSubmitted()

add

public void add(char opt)
Adds the specified single-character option after checking against and removing the option from the set of identifiers. If the passed in option opt is not a member of the set of identifers, then a IllegalArgumentException is thrown.

See Also:
getSubmitted()

getSubmitted

public List<String> getSubmitted()
Returns the list of options submitted in the order they were received through the either of the add methods.

See Also:
add(String), add(char)


SourceForge.net Logo