public class StringParameter extends AbstractParameter<StringParameter,java.lang.String>
constraints, defaultValue, givenValue, optionalParameter, optionid, shortDescription
Constructor and Description |
---|
StringParameter(OptionID optionID)
Constructs a string parameter with the given optionID.
|
StringParameter(OptionID optionID,
java.lang.String defaultValue)
Constructs a string parameter with the given optionID, and default value.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getSyntax()
Returns a string representation of the parameter's type.
|
java.lang.String |
getValueAsString()
Get the value as string.
|
protected java.lang.String |
parseValue(java.lang.Object obj)
Parse a given value into the destination type.
|
addConstraint, describeValues, getConstraints, getDefaultValue, getDefaultValueAsString, getOptionID, getShortDescription, getValue, hasDefaultValue, isDefined, isOptional, isValid, setDefaultValue, setOptional, setShortDescription, setValue, setValueInternal, tookDefaultValue, tryDefaultValue, validate
public StringParameter(OptionID optionID, java.lang.String defaultValue)
optionID
- the unique id of the parameterdefaultValue
- the default value of the parameterpublic StringParameter(OptionID optionID)
optionID
- the unique id of the parameterpublic java.lang.String getValueAsString()
Parameter
null
getValueAsString
in interface Parameter<java.lang.String>
getValueAsString
in class AbstractParameter<StringParameter,java.lang.String>
protected java.lang.String parseValue(java.lang.Object obj) throws ParameterException
AbstractParameter
parseValue
in class AbstractParameter<StringParameter,java.lang.String>
obj
- Object to parse (may be a string representation!)ParameterException
- when the object cannot be parsed.public java.lang.String getSyntax()
getSyntax
in interface Parameter<java.lang.String>
getSyntax
in class AbstractParameter<StringParameter,java.lang.String>
Copyright © 2019 ELKI Development Team. License information.