FreeHEP API
Version current

org.freehep.util.argv
Class ListParameter

java.lang.Object
  extended byorg.freehep.util.argv.ListParameter
All Implemented Interfaces:
Parameter

public class ListParameter
extends Object
implements Parameter

A List parameter for use with ArgumentParser. A List parameter consumes all values it sees in the command line arguments and returns them as a list. The order of the values is preserved. Because this parameter consumes all available values, it should be registered as the last parameter added to an ArgumentParser instance.

Source Code:
ListParameter.java

Constructor Summary
ListParameter(String name, String description)
          Initialize a new List parameter with the given description.
 
Method Summary
 String getName()
          Must return name of the parameter.
 String getUsage()
          Usage method invoked by ArgumentParser.
 List getValue()
          Returns the list of values collected by this parameter.
 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

ListParameter

public ListParameter(String name,
                     String description)
Initialize a new List parameter with the given description.

Method Detail

getValue

public List getValue()
Returns the list of values collected by this parameter. The list may be empty but is never null.


parse

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

Specified by:
parse in interface Parameter

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.