org.freehep.util.argv
Class StringParameter

java.lang.Object
  extended by org.freehep.util.argv.StringParameter
All Implemented Interfaces:
Parameter

public class StringParameter
extends Object
implements Parameter

A String parameter for use with ArgumentParser.

Version:
$Id: StringParameter.java 8584 2006-08-10 23:06:37Z duns $
Author:
Mark Donszelmann

Constructor Summary
StringParameter(String name, String description)
          Initialize a new String argument with the given flag and description but without a default value.
 
Method Summary
 String getName()
          Must return name of the parameter.
 String getUsage()
          Usage method invoked by ArgumentParser.
 String getValue()
          Return the string value of this argument, which may be null.
 int parse(List values)
          Parsing method invoked by ArgumentParser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringParameter

public StringParameter(String name,
                       String description)
Initialize a new String argument with the given flag and description but without a default value.

Method Detail

getValue

public String getValue()
Return the string value of this argument, which may be null. Returns the default value if the value was not set when the command line was parsed.


parse

public int parse(List values)
          throws MissingArgumentException
Parsing method invoked by ArgumentParser.

Specified by:
parse in interface Parameter
Throws:
MissingArgumentException

getName

public String getName()
Description copied from interface: Parameter
Must return name of the parameter.

Specified by:
getName in interface Parameter

getUsage

public String getUsage()
Usage method invoked by ArgumentParser.

Specified by:
getUsage in interface Parameter


Copyright © 2000-2007 FreeHEP. All Rights Reserved.