marf.util
Class OptionProcessor.Option

java.lang.Object
  extended by marf.util.OptionProcessor.Option
Enclosing class:
OptionProcessor

protected class OptionProcessor.Option
extends java.lang.Object

Main Option placeholder.

Since:
0.3.0.3
Author:
Serguei Mokhov

Field Summary
protected  boolean bHasArgument
          A flag is set to true if the option has its argument set.
protected  boolean bRequiresArgument
          A flag is set to true if the option has a mandatory argument.
protected  int iOptionEnum
          Internal container for integer equivalent; default is UNDEF.
protected  java.lang.String strOptionArgument
          Internal container for option argument; default is "".
protected  java.lang.String strOptionName
          Internal container for option name; default is "UNDEFINED".
 
Constructor Summary
OptionProcessor.Option(java.lang.Integer poOption, java.lang.String pstrOption)
          Vanilla integer/string option constructor.
OptionProcessor.Option(int piOption, java.lang.String pstrOption)
          Vanilla integer/string option constructor.
OptionProcessor.Option(int piOption, java.lang.String pstrOption, boolean pbRequiresArgument)
          Integer/string option constructor with required argument indication.
OptionProcessor.Option(int piOption, java.lang.String pstrOption, java.lang.String pstrRequiredArgument)
          Integer/string option constructor with required argument.
 
Method Summary
 java.lang.String getOptionArgument()
          Retrieves the option argument string.
 int getOptionEnumeration()
          Retrieves the option number.
 java.lang.String getOptionName()
          Retrieves the option name.
 boolean hasArgument()
          Tells if this option has an argument set.
 boolean requiresArgument()
          Tells if this option requires an argument.
 void requiresArgument(boolean pbRequiresArgument)
          Allows to specify whether this option requires an argument or not.
 void setOptionArgument(java.lang.String pstrOptionArgument)
          Allows setting the option argument.
 void setOptionEnumeration(int piOptionEnum)
          Allows setting the option number.
 void setStrOptionName(java.lang.String pstrOptionName)
          Allows setting the option name.
 java.lang.String toString()
          String representation of the option.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

strOptionName

protected java.lang.String strOptionName
Internal container for option name; default is "UNDEFINED".


strOptionArgument

protected java.lang.String strOptionArgument
Internal container for option argument; default is "".


iOptionEnum

protected int iOptionEnum
Internal container for integer equivalent; default is UNDEF.

See Also:
OptionProcessor.UNDEF

bRequiresArgument

protected boolean bRequiresArgument
A flag is set to true if the option has a mandatory argument.


bHasArgument

protected boolean bHasArgument
A flag is set to true if the option has its argument set.

Since:
0.3.0.6
Constructor Detail

OptionProcessor.Option

public OptionProcessor.Option(int piOption,
                              java.lang.String pstrOption)
Vanilla integer/string option constructor. Equivalent to Option(piOption, pstrOption, false).

Parameters:
piOption - integer option equivalent
pstrOption - String option equivalent

OptionProcessor.Option

public OptionProcessor.Option(java.lang.Integer poOption,
                              java.lang.String pstrOption)
Vanilla integer/string option constructor. Equivalent to Option(piOption, pstrOption, false).

Parameters:
poOption - integer option equivalent
pstrOption - String option equivalent
Since:
0.3.0.5

OptionProcessor.Option

public OptionProcessor.Option(int piOption,
                              java.lang.String pstrOption,
                              boolean pbRequiresArgument)
Integer/string option constructor with required argument indication.

Parameters:
piOption - integer option equivalent
pstrOption - String option equivalent
pbRequiresArgument - true if option requires an argument

OptionProcessor.Option

public OptionProcessor.Option(int piOption,
                              java.lang.String pstrOption,
                              java.lang.String pstrRequiredArgument)
Integer/string option constructor with required argument.

Parameters:
piOption - integer option equivalent
pstrOption - String option equivalent
pstrRequiredArgument - the option argument
Method Detail

requiresArgument

public boolean requiresArgument()
Tells if this option requires an argument.

Returns:
true if the argument is required

requiresArgument

public void requiresArgument(boolean pbRequiresArgument)
Allows to specify whether this option requires an argument or not.

Parameters:
pbRequiresArgument - true if the argument is required

hasArgument

public boolean hasArgument()
Tells if this option has an argument set.

Returns:
true if the argument is set
Since:
0.3.0.6

getOptionEnumeration

public int getOptionEnumeration()
Retrieves the option number.

Returns:
the enumeration option value

setOptionEnumeration

public void setOptionEnumeration(int piOptionEnum)
Allows setting the option number.

Parameters:
piOptionEnum - the option number to set

getOptionArgument

public java.lang.String getOptionArgument()
Retrieves the option argument string.

Returns:
the argument.

setOptionArgument

public void setOptionArgument(java.lang.String pstrOptionArgument)
Allows setting the option argument.

Parameters:
pstrOptionArgument - the option argument to set.

getOptionName

public java.lang.String getOptionName()
Retrieves the option name.

Returns:
the name

setStrOptionName

public void setStrOptionName(java.lang.String pstrOptionName)
Allows setting the option name.

Parameters:
pstrOptionName - the option name to set

toString

public java.lang.String toString()
String representation of the option.

Overrides:
toString in class java.lang.Object
Returns:
String containing option name, its numeric value, and its argument
See Also:
Object.toString()


SourceForge Logo