public class DoubleOption extends Option
Copyright (C) Damian Ryan Eads, 2001. All Rights Reserved. ritopt is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. ritopt is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with ritopt; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
DEFAULT_FILE_COMMENT_SIZE, DEFAULT_FILE_COMPLETE_OPTION_SIZE, DEFAULT_HELP_DEPRECATED_SIZE, DEFAULT_HELP_DESCRIPTION_SIZE, DEFAULT_HELP_OPTION_SIZE, DEFAULT_HELP_TYPENAME_SIZE, DEFAULT_MENU_DEPRECATED_SIZE, DEFAULT_MENU_DESCRIPTION_SIZE, DEFAULT_MENU_OPTION_SIZE, DEFAULT_MENU_TYPENAME_SIZE, invoked
Constructor and Description |
---|
DoubleOption()
Constructs a double option that is initially set to zero.
|
DoubleOption(double value)
Constructs a double option initialized with the value passed.
|
DoubleOption(double value,
char shortOption)
Constructs a character option initialized with the value and
short option passed.
|
DoubleOption(DoubleOption op)
Constructs a double option by copying the double option passed.
|
DoubleOption(double value,
java.lang.String longOption)
Constructs a double option initialized with the value and
long option passed.
|
DoubleOption(double value,
java.lang.String longOption,
char shortOption)
Constructs a double option initialized with the value, short
and long option passed.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getObject()
Return the value as an object.
|
java.lang.String |
getStringValue()
Return this option as a string.
|
java.lang.String |
getTypeName()
Returns the type name of this option.
|
double |
getValue()
Return this option as a double.
|
void |
modify(java.lang.String value)
Modify this option based on a string representation.
|
void |
setValue(double value)
Modify this option using a double value.
|
void |
setValue(java.lang.String value)
Modify this option based on a string representation.
|
java.lang.String |
toString()
Returns a string representation of this object.
|
action, deprecate, getDescription, getFileCommentSize, getFileCompleteOptionSize, getHashKey, getHashKey, getHashKey, getHashKey, getHelp, getHelpDeprecated, getHelpDeprecatedSize, getHelpDescription, getHelpDescriptionSize, getHelpHeader, getHelpOptionSpecification, getHelpOptionSpecificationSize, getHelpTypeName, getHelpTypenameSize, getLongOption, getMenuDeprecatedSize, getMenuDescriptionSize, getMenuOptionSpecificationSize, getMenuTypenameSize, getName, getOptionFileLine, getShortOption, isDeprecated, isInvoked, setDeprecated, setDescription, setFileCommentSize, setFileCompleteOptionSize, setHelpDeprecatedSize, setHelpDescriptionSize, setHelpOptionSpecificationSize, setHelpTypenameSize, setInvoked, setKey, setKey, setLongOption, setMenuDeprecatedSize, setMenuDescriptionSize, setMenuOptionSpecificationSize, setMenuTypenameSize, setShortOption
public DoubleOption()
public DoubleOption(DoubleOption op)
op
- The character option to copy.public DoubleOption(double value)
value
- The initial value of this double option.public DoubleOption(double value, java.lang.String longOption)
value
- The initial value of this double option.longOption
- The long option associated with double option.public DoubleOption(double value, char shortOption)
value
- The initial value of this double option.shortOption
- The short option associated with this option.public DoubleOption(double value, java.lang.String longOption, char shortOption)
shortOption
- The short option associated with this option.longOption
- The long option associated with this option.value
- The initial value of this double option.public java.lang.Object getObject()
public void modify(java.lang.String value) throws OptionModificationException
value
- String representation of the object.OptionModificationException
- Thrown if an error occurs
during modification of an option.public void setValue(java.lang.String value) throws OptionModificationException
value
- String representation of the object.OptionModificationException
- Thrown if an error occurs
during modification of an option.public void setValue(double value)
value
- A double value.public double getValue()
public java.lang.String getStringValue()
getStringValue
in class Option
public java.lang.String getTypeName()
getTypeName
in class Option
public java.lang.String toString()
toString
in class java.lang.Object