public class PatternParameter extends AbstractParameter<PatternParameter,java.util.regex.Pattern>
constraints, defaultValue, givenValue, optionalParameter, optionid, shortDescription
Constructor and Description |
---|
PatternParameter(OptionID optionID)
Constructs a pattern parameter with the given optionID.
|
PatternParameter(OptionID optionID,
java.util.regex.Pattern defaultValue)
Constructs a pattern parameter with the given optionID, and default value.
|
PatternParameter(OptionID optionID,
java.lang.String defaultValue)
Constructs a pattern 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.util.regex.Pattern |
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 PatternParameter(OptionID optionID, java.util.regex.Pattern defaultValue)
optionID
- the unique id of the parameterdefaultValue
- the default value of the parameterpublic PatternParameter(OptionID optionID, java.lang.String defaultValue)
optionID
- the unique id of the parameterdefaultValue
- the default value of the parameterpublic PatternParameter(OptionID optionID)
optionID
- the unique id of the parameterpublic java.lang.String getValueAsString()
Parameter
null
getValueAsString
in interface Parameter<java.util.regex.Pattern>
getValueAsString
in class AbstractParameter<PatternParameter,java.util.regex.Pattern>
protected java.util.regex.Pattern parseValue(java.lang.Object obj) throws ParameterException
AbstractParameter
parseValue
in class AbstractParameter<PatternParameter,java.util.regex.Pattern>
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.util.regex.Pattern>
getSyntax
in class AbstractParameter<PatternParameter,java.util.regex.Pattern>
Copyright © 2019 ELKI Development Team. License information.