org.dllearner.core.options
Class StringConfigOption
java.lang.Object
org.dllearner.core.options.ConfigOption<String>
org.dllearner.core.options.StringConfigOption
public class StringConfigOption
- extends ConfigOption<String>
A configuration option, which allows values of type String. Optionally a set
of allowed strings can be set. By default all strings are allowed.
- Author:
- Jens Lehmann
| Methods inherited from class org.dllearner.core.options.ConfigOption |
getDefaultValue, getDescription, getJavaDocString, getJavaImports, getName, isMandatory, requiresInit, setDefaultValue, setMandatory, setRequiresInit, toString |
StringConfigOption
public StringConfigOption(String name,
String description)
StringConfigOption
public StringConfigOption(String name,
String description,
String defaultValue)
StringConfigOption
public StringConfigOption(String name,
String description,
String defaultValue,
boolean mandatory,
boolean requiresInit)
getDefaultValueInJava
public String getDefaultValueInJava()
- Overrides:
getDefaultValueInJava in class ConfigOption<String>
- Returns:
- the defaultValue
getValueTypeAsJavaString
public String getValueTypeAsJavaString()
- Specified by:
getValueTypeAsJavaString in class ConfigOption<String>
isValidValue
public boolean isValidValue(String 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<String>
- Parameters:
value - A value for the option.
- Returns:
- True if the value is valid and false otherwise.
getAllowedValues
public Set<String> getAllowedValues()
- Returns:
- the allowedValues
getAllowedValuesDescription
public String getAllowedValuesDescription()
- Overrides:
getAllowedValuesDescription in class ConfigOption<String>
setAllowedValues
public void setAllowedValues(Set<String> allowedValues)
- Parameters:
allowedValues - the allowedValues to set
setAllowedValues
public void setAllowedValues(String[] allowedValues)
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<String>
- Parameters:
object - The object to check.
- Returns:
- True of the type is correct, false otherwise.
getValueFormatting
public String getValueFormatting(String value)
- Description copied from class:
ConfigOption
- Get a formatted value to put into configuration file.
- Specified by:
getValueFormatting in class ConfigOption<String>
- Parameters:
value - Option value.
- Returns:
- A string to put into a conf file.
DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2011 Jens Lehmann