net.sourceforge.openstego.util
Class CmdLineParser

java.lang.Object
  extended bynet.sourceforge.openstego.util.CmdLineParser

public class CmdLineParser
extends Object

Utility to parse the command line parameters


Constructor Summary
CmdLineParser(CmdLineOptions stdOptions, String[] args)
          Constructor
 
Method Summary
 List getNonStdOptions()
          Method to get the list of non-standard options
 int getNumOfOptions()
          Method to get the total number of options (standard plus non-standard) provided in the command-line
 String getOptionName(int index)
          Method to get the name of the option by index
 String getOptionValue(String name)
          Method to get the value of the given option (by name)
 CmdLineOptions getParsedOptions()
          Get method for parsedOptions
 List getParsedOptionsAsList()
          Method to get the list of standard options
 boolean isValid()
          Method to check whether the command-line options are valid or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmdLineParser

public CmdLineParser(CmdLineOptions stdOptions,
                     String[] args)
Constructor

Parameters:
stdOptions - List of standard options
args - Command line arguments
Method Detail

isValid

public boolean isValid()
Method to check whether the command-line options are valid or not. This should be called immediately after the constructor is called.

Returns:
Flag to indicate whether options are valid or not

getOptionValue

public String getOptionValue(String name)
Method to get the value of the given option (by name)

Parameters:
name - Name of the option
Returns:
Value of the command-line option

getOptionName

public String getOptionName(int index)
Method to get the name of the option by index

Parameters:
index - Index of the option
Returns:
Name of the command-line option

getParsedOptionsAsList

public List getParsedOptionsAsList()
Method to get the list of standard options

Returns:
List of standard options

getNonStdOptions

public List getNonStdOptions()
Method to get the list of non-standard options

Returns:
List of non-standard options

getParsedOptions

public CmdLineOptions getParsedOptions()
Get method for parsedOptions

Returns:
parsedOptions

getNumOfOptions

public int getNumOfOptions()
Method to get the total number of options (standard plus non-standard) provided in the command-line

Returns:
Total number of options provided in the command-line


Copyright © 2007-2008 Samir Vaidya. All Rights Reserved.