Package elki.utilities.optionhandling
Class OptionID
- java.lang.Object
-
- elki.utilities.optionhandling.OptionID
-
public final class OptionID extends java.lang.Object
An OptionID is used by option handlers as a unique identifier for specific options. There is no option possible without a specific OptionID defined within this class.- Since:
- 0.1
- Author:
- Elke Achtert
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
description
The description of the OptionID.private java.lang.String
name
Option name
-
Constructor Summary
Constructors Constructor Description OptionID(java.lang.String name, java.lang.String description)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDescription()
Returns the description of this OptionID.java.lang.String
getName()
Get the option name.static OptionID
getOrCreateOptionID(java.lang.String name, java.lang.String description)
Gets or creates the OptionID for the given class and given name.java.lang.String
toString()
Returns the name of this OptionID.
-
-
-
Method Detail
-
getDescription
public java.lang.String getDescription()
Returns the description of this OptionID.- Returns:
- the description of this OptionID
-
getOrCreateOptionID
public static final OptionID getOrCreateOptionID(java.lang.String name, java.lang.String description)
Gets or creates the OptionID for the given class and given name. The OptionID usually is named as the classes name (lowercase) as name-prefix and the given name as suffix of the complete name, separated by a dot. For example, the parameterepsilon
for the classDBSCAN
will be nameddbscan.epsilon
.- Parameters:
name
- the namedescription
- the description is also set if the named OptionID does exist already- Returns:
- the OptionID for the given name
-
toString
public java.lang.String toString()
Returns the name of this OptionID.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the name
- See Also:
Object.toString()
-
getName
public java.lang.String getName()
Get the option name.- Returns:
- Option name
-
-