FreeHEP API
Version current

org.freehep.util.argv
Class StringParameter

java.lang.Object
  extended byorg.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,v 1.1 2004/01/12 20:19:27 duns Exp $
Author:
Mark Donszelmann
Source Code:
StringParameter.java

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

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.