SigPath

edu.mssm.crover.cli
Class CLI

java.lang.Object
  extended by edu.mssm.crover.cli.CLI

Deprecated. use commons cli instead.

public final class CLI
extends Object

Provides general services needed by Command Line Interface programs. These services include: configuration of the environment through a property file, methods to parse options from the command line.

Author:
F. Campagne

Method Summary
 boolean fileExists(String filename)
          Deprecated.  
static double getDoubleOption(String[] args, String option, double defaultValue)
          Deprecated. Extracts a double parameter from the command line arguments.
static float getFloatOption(String[] args, String option, float defaultValue)
          Deprecated. Extracts a float parameter from the command line arguments.
static CLI getInstance()
          Deprecated. Returns the singleton instance of CLI.
 String getInstanceProperty(String propertyName)
          Deprecated. Returns the value of a property.
static int getIntOption(String[] args, String option, int defaultValue)
          Deprecated. Extracts an integer parameter from the command line arguments.
static long getLongOption(String[] args, String option, long defaultValue)
          Deprecated. Extracts a long parameter from the command line arguments.
static String getOption(String[] args, String option, String defaultValue)
          Deprecated. Extracts an option parameter from the command line arguments.
static String[] getOptions(String[] args, String keyword)
          Deprecated. Returns an array of all the options given for a given keyword.
static String[] getOptions(String[] args, String keyword, String[] defaultValue)
          Deprecated. Returns an array of all the options given for a given keyword.
static String[] getOrderedOptions(String[] args, String keyword)
          Deprecated. Returns an array of all the options given for a given keyword in the order the are given on the command line.
static String getProperty(String propertyName)
          Deprecated. Returns the value of a property.
static String getProperty(String propertyName, String defaultValue)
          Deprecated. Returns the value of a property.
static String[] getTwoPartOptions(String[] args, String keyword)
          Deprecated. Returns an array of all the options given for a given keyword.
static boolean isKeywordGiven(String[] args, String keyword)
          Deprecated. Extracts a boolean keyword from the command line arguments.
static boolean isKeywordGiven(String[] args, String keyword, boolean defaultValue)
          Deprecated. Extracts a boolean keyword from the command line arguments.
 void loadProperties()
          Deprecated.  
static String[] printOptions(String[] args, org.apache.commons.logging.Log log)
          Deprecated.  
static String[] printOptions(String[] args, PrintStream out)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static CLI getInstance()
Deprecated. 
Returns the singleton instance of CLI. Properties are read now. The location of the file from were to load them is one of these, whichever comes first:

Returns:
an instance of CLI.

loadProperties

public void loadProperties()
Deprecated. 

fileExists

public boolean fileExists(String filename)
Deprecated. 

getInstanceProperty

public String getInstanceProperty(String propertyName)
Deprecated. 
Returns the value of a property. The system properties are searched first. If the property is found, its value is returned, otherwise the crover properties are searched.


getProperty

public static String getProperty(String propertyName)
Deprecated. 
Returns the value of a property. This method can be called without an explicit instance.


getProperty

public static String getProperty(String propertyName,
                                 String defaultValue)
Deprecated. 
Returns the value of a property. This method can be called without an explicit instance.

Parameters:
defaultValue - The value to be returned when the property is not defined.
Returns:
The property value, or the default value when the former is null.

getOption

public static String getOption(String[] args,
                               String option,
                               String defaultValue)
Deprecated. 
Extracts an option parameter from the command line arguments. For boolean attributes, see isKeywordGiven.

Parameters:
args - The command line arguments.
option - the name of the parameter (name value pairs are assumed)
defaultValue - The value that is returned when the keyword is not found on the command line.

isKeywordGiven

public static boolean isKeywordGiven(String[] args,
                                     String keyword,
                                     boolean defaultValue)
Deprecated. 
Extracts a boolean keyword from the command line arguments.

Parameters:
args - The command line arguments.
keyword - the name of the optional keyword.
defaultValue - The value that is returned when the keyword is not found on the command line.
Returns:
true if a keyword (also called flag) is given on the command line. Flase otherwise.

isKeywordGiven

public static boolean isKeywordGiven(String[] args,
                                     String keyword)
Deprecated. 
Extracts a boolean keyword from the command line arguments. Assumes false default values.

Parameters:
args - The command line arguments.
keyword - the name of the optional keyword.

getLongOption

public static long getLongOption(String[] args,
                                 String option,
                                 long defaultValue)
Deprecated. 
Extracts a long parameter from the command line arguments.

Parameters:
args - The command line arguments.
option - the name of the parameter (name value pairs are assumed)
defaultValue - The value that is returned when the keyword is not found on the command line.

getIntOption

public static int getIntOption(String[] args,
                               String option,
                               int defaultValue)
Deprecated. 
Extracts an integer parameter from the command line arguments.

Parameters:
args - The command line arguments.
option - the name of the parameter (name value pairs are assumed)
defaultValue - The value that is returned when the keyword is not found on the command line.

getDoubleOption

public static double getDoubleOption(String[] args,
                                     String option,
                                     double defaultValue)
Deprecated. 
Extracts a double parameter from the command line arguments.

Parameters:
args - The command line arguments.
option - the name of the parameter (name value pairs are assumed)
defaultValue - The value that is returned when the keyword is not found on the command line.

getFloatOption

public static float getFloatOption(String[] args,
                                   String option,
                                   float defaultValue)
Deprecated. 
Extracts a float parameter from the command line arguments.

Parameters:
args - The command line arguments.
option - the name of the parameter (name value pairs are assumed)
defaultValue - The value that is returned when the keyword is not found on the command line.

getOptions

public static String[] getOptions(String[] args,
                                  String keyword)
Deprecated. 
Returns an array of all the options given for a given keyword.

Parameters:
args - The command line arguments.
keyword -

getOrderedOptions

public static String[] getOrderedOptions(String[] args,
                                         String keyword)
Deprecated. 
Returns an array of all the options given for a given keyword in the order the are given on the command line.

Parameters:
args - The command line arguments.
keyword -

getTwoPartOptions

public static String[] getTwoPartOptions(String[] args,
                                         String keyword)
Deprecated. 
Returns an array of all the options given for a given keyword. Options are defined as being two words long.

Parameters:
args - The command line arguments.
keyword -

getOptions

public static String[] getOptions(String[] args,
                                  String keyword,
                                  String[] defaultValue)
Deprecated. 
Returns an array of all the options given for a given keyword. Returns null if no keyword found.


printOptions

public static String[] printOptions(String[] args,
                                    PrintStream out)
Deprecated. 

printOptions

public static String[] printOptions(String[] args,
                                    org.apache.commons.logging.Log log)
Deprecated. 

SigPath

Copyright © 2002-2005 Institute for Computational Biomedicine, All Rights Reserved.