org.dllearner.core.options
Class DoubleConfigOption

java.lang.Object
  extended by org.dllearner.core.options.ConfigOption<Double>
      extended by org.dllearner.core.options.DoubleConfigOption

public class DoubleConfigOption
extends ConfigOption<Double>

Represents a configuration option with values of type value. Similar to the integer option a minimum and a maximum value can specified.

Author:
Jens Lehmann

Constructor Summary
DoubleConfigOption(String name, String description)
           
DoubleConfigOption(String name, String description, Double defaultValue)
           
 
Method Summary
 boolean checkType(Object object)
          Checks whether the object has the correct type to be used as a value for this option (this method is necessary, because generic information is erased at runtime in Java).
 String getAllowedValuesDescription()
           
 double getLowerLimit()
           
 double getUpperLimit()
           
 String getValueFormatting(Double value)
          Get a formatted value to put into configuration file.
 String getValueTypeAsJavaString()
           
 boolean isValidValue(Double value)
          Checks whether the value is valid, e.g. passing 1985 as integer value for an option, which requires values between 0 and 1, is not valid.
 void setLowerLimit(double lowerLimit)
           
 void setUpperLimit(double upperLimit)
           
 
Methods inherited from class org.dllearner.core.options.ConfigOption
getDefaultValue, getDefaultValueInJava, getDescription, getJavaDocString, getJavaImports, getName, isMandatory, requiresInit, setDefaultValue, setMandatory, setRequiresInit, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DoubleConfigOption

public DoubleConfigOption(String name,
                          String description,
                          Double defaultValue)

DoubleConfigOption

public DoubleConfigOption(String name,
                          String description)
Method Detail

getValueTypeAsJavaString

public String getValueTypeAsJavaString()
Specified by:
getValueTypeAsJavaString in class ConfigOption<Double>

isValidValue

public boolean isValidValue(Double value)
Description copied from class: ConfigOption
Checks whether the value is valid, e.g. passing 1985 as integer value for an option, which requires values between 0 and 1, is not valid.

Specified by:
isValidValue in class ConfigOption<Double>
Parameters:
value - A value for the option.
Returns:
True if the value is valid and false otherwise.

getLowerLimit

public double getLowerLimit()
Returns:
the The lowest possible value for this configuration option.

setLowerLimit

public void setLowerLimit(double lowerLimit)
Parameters:
lowerLimit - The lowest possible value for this configuration option.

getUpperLimit

public double getUpperLimit()
Returns:
the The highest possible value for this configuration option.

setUpperLimit

public void setUpperLimit(double upperLimit)
Parameters:
upperLimit - The highest possible value for this configuration option.

checkType

public boolean checkType(Object object)
Description copied from class: ConfigOption
Checks whether the object has the correct type to be used as a value for this option (this method is necessary, because generic information is erased at runtime in Java).

Specified by:
checkType in class ConfigOption<Double>
Parameters:
object - The object to check.
Returns:
True of the type is correct, false otherwise.

getAllowedValuesDescription

public String getAllowedValuesDescription()
Overrides:
getAllowedValuesDescription in class ConfigOption<Double>

getValueFormatting

public String getValueFormatting(Double value)
Description copied from class: ConfigOption
Get a formatted value to put into configuration file.

Specified by:
getValueFormatting in class ConfigOption<Double>
Parameters:
value - Option value.
Returns:
A string to put into a conf file.


SourceForge.net Logo DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2011 Jens Lehmann