|
|
|||||||||||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||||||||||
java.lang.Objectde.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.Parameter<Class<?>,Class<? extends C>>
de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.ClassParameter<C>
C - Class typepublic class ClassParameter<C>
Parameter class for a parameter specifying a class name.
| Field Summary | |
|---|---|
static String |
NONBREAKING_SPACE
Non-breaking unicode space character. |
protected Class<C> |
restrictionClass
The restriction class for this class parameter. |
| Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.Parameter |
|---|
constraints, defaultValue, givenValue, optionalParameter, optionid, shortDescription |
| Constructor Summary | |
|---|---|
ClassParameter(OptionID optionID,
Class<?> restrictionClass)
Constructs a class parameter with the given optionID, and restriction class. |
|
ClassParameter(OptionID optionID,
Class<?> restrictionClass,
boolean optional)
Constructs a class parameter with the given optionID, restriction class, and optional flag. |
|
ClassParameter(OptionID optionID,
Class<?> restrictionClass,
Class<?> defaultValue)
Constructs a class parameter with the given optionID, restriction class, and default value. |
|
| Method Summary | |
|---|---|
IterableIterator<Class<?>> |
getKnownImplementations()
Get an iterator over all known implementations of the class restriction. |
Class<C> |
getRestrictionClass()
Returns the restriction class of this class parameter. |
String[] |
getRestrictionClasses()
Returns the class names allowed according to the restriction class of this class parameter. |
String |
getSyntax()
Returns a string representation of the parameter's type. |
String |
getValueAsString()
Get the value as string. |
String |
getValuesDescription()
Return a description of known valid classes. |
boolean |
hasValuesDescription()
This class sometimes provides a list of value descriptions. |
C |
instantiateClass(Parameterization config)
Returns a new instance for the value (i.e., the class name) of this class parameter. |
protected Class<? extends C> |
parseValue(Object obj)
Parse a given value into the destination type. |
String |
restrictionString()
Provides a description string listing all classes for the given superclass or interface as specified in the properties. |
boolean |
validate(Class<? extends C> obj)
Checks if the given parameter value is valid for this ClassParameter. |
| Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.Parameter |
|---|
getDefaultValue, getFullDescription, getGivenValue, getName, getOptionID, getShortDescription, getValue, hasDefaultValue, isDefined, isOptional, isValid, setDefaultValue, setOptional, setShortDescription, setValue, setValueInternal, tookDefaultValue, tryDefaultValue, useDefaultValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Class<C> restrictionClass
public static final String NONBREAKING_SPACE
| Constructor Detail |
|---|
public ClassParameter(OptionID optionID,
Class<?> restrictionClass,
Class<?> defaultValue)
optionID - the unique id of the optionrestrictionClass - the restriction class of this class parameterdefaultValue - the default value of this class parameter
public ClassParameter(OptionID optionID,
Class<?> restrictionClass,
boolean optional)
optionID - the unique id of the optionrestrictionClass - the restriction class of this class parameteroptional - specifies if this parameter is an optional parameter
public ClassParameter(OptionID optionID,
Class<?> restrictionClass)
optionID - the unique id of the optionrestrictionClass - the restriction class of this class parameter| Method Detail |
|---|
protected Class<? extends C> parseValue(Object obj)
throws ParameterException
parseValue in class Parameter<Class<?>,Class<? extends C>>obj - Object to parse (may be a string representation!)
ParameterException - when the object cannot be parsed.
public boolean validate(Class<? extends C> obj)
throws ParameterException
validate in class Parameter<Class<?>,Class<? extends C>>obj - Object to validate
ParameterException - when the object is not valid.public String getSyntax()
getSyntax in class Parameter<Class<?>,Class<? extends C>>public boolean hasValuesDescription()
hasValuesDescription in class Parameter<Class<?>,Class<? extends C>>Parameter.hasValuesDescription()public String getValuesDescription()
getValuesDescription in class Parameter<Class<?>,Class<? extends C>>Parameter.getValuesDescription()public String getValueAsString()
Parameternull
getValueAsString in class Parameter<Class<?>,Class<? extends C>>public C instantiateClass(Parameterization config)
config - Parameterization to use (if Parameterizable))
public Class<C> getRestrictionClass()
public IterableIterator<Class<?>> getKnownImplementations()
Iterable and Iterator objectpublic String[] getRestrictionClasses()
public String restrictionString()
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||