net.praqma.util.option
Class Option

java.lang.Object
  extended by net.praqma.util.option.Option

public class Option
extends Object

This represents an CLI option.

Author:
wolfgang

Field Summary
 int arguments
           
 String description
           
 String longName
           
 boolean required
           
 String shortName
           
 boolean used
           
 List<String> values
           
 
Constructor Summary
Option(String longName, String shortName)
           
Option(String longName, String shortName, boolean required)
           
Option(String longName, String shortName, boolean optional, int arguments)
           
Option(String longName, String shortName, boolean required, int arguments, String description)
          Constructor for Option, given a full set of parameters.
Option(String longName, String shortName, String value)
           
 
Method Summary
 void addValue(String value)
           
 double getRealSum()
           
 String getString()
           
 int getSum()
           
 void setUsed()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

values

public List<String> values

longName

public String longName

shortName

public String shortName

arguments

public int arguments

used

public boolean used

required

public boolean required

description

public String description
Constructor Detail

Option

public Option(String longName,
              String shortName,
              String value)

Option

public Option(String longName,
              String shortName)

Option

public Option(String longName,
              String shortName,
              boolean required)

Option

public Option(String longName,
              String shortName,
              boolean optional,
              int arguments)

Option

public Option(String longName,
              String shortName,
              boolean required,
              int arguments,
              String description)
Constructor for Option, given a full set of parameters.

Parameters:
longName - The long name for an option. Multiple characters.
Of the form:
--option="some option"
--option=a b c
--option a b c
shortName - The short name of an option. A single character.
Of the form:
-o
-o 1
required - Is the option required? true / false.
arguments - How many arguments does the option have? 0 ... n
description - A description for the display method.
Method Detail

setUsed

public void setUsed()

addValue

public void addValue(String value)

getString

public String getString()

getSum

public int getSum()
           throws Exception
Throws:
Exception

getRealSum

public double getRealSum()
                  throws Exception
Throws:
Exception


Copyright © 2011. All Rights Reserved.