org.dllearner.core.options
Class IntegerConfigOption

java.lang.Object
  extended by org.dllearner.core.options.ConfigOption<Integer>
      extended by org.dllearner.core.options.IntegerConfigOption

public class IntegerConfigOption
extends ConfigOption<Integer>

A configuration option, which allows values of type integer. A minimum and maximum value of the argument can optionally be specified.

Author:
Jens Lehmann

Constructor Summary
IntegerConfigOption(String name, String description)
           
IntegerConfigOption(String name, String description, Integer defaultValue)
           
IntegerConfigOption(String name, String description, Integer defaultValue, boolean mandatory, boolean requiresInit)
           
 
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()
           
 int getLowerLimit()
           
 int getUpperLimit()
           
 String getValueFormatting(Integer value)
          Get a formatted value to put into configuration file.
 String getValueTypeAsJavaString()
           
 boolean isValidValue(Integer 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(int lowerLimit)
           
 void setUpperLimit(int 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

IntegerConfigOption

public IntegerConfigOption(String name,
                           String description,
                           Integer defaultValue,
                           boolean mandatory,
                           boolean requiresInit)

IntegerConfigOption

public IntegerConfigOption(String name,
                           String description,
                           Integer defaultValue)

IntegerConfigOption

public IntegerConfigOption(String name,
                           String description)
Method Detail

getValueTypeAsJavaString

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

isValidValue

public boolean isValidValue(Integer 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<Integer>
Parameters:
value - A value for the option.
Returns:
True if the value is valid and false otherwise.

getLowerLimit

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

setLowerLimit

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

getUpperLimit

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

setUpperLimit

public void setUpperLimit(int 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<Integer>
Parameters:
object - The object to check.
Returns:
True of the type is correct, false otherwise.

getAllowedValuesDescription

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

getValueFormatting

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

Specified by:
getValueFormatting in class ConfigOption<Integer>
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-2008 Jens Lehmann