Package chemaxon.marvin.util
Class OptionDescriptor
java.lang.Object
chemaxon.marvin.util.OptionDescriptor
General option descriptor class.
- Since:
- Marvin 5.0, 06/05/2007
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intBoolean option.static final intPositive real number. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the description.Gets the inverse option name.getName()Gets the option name.String[]Gets the options that must be deselected if this option is selected.String[]Gets the options that must be switched off if this option is selected.String[]Gets the options that must be switched off if this option is selected.intgetType()Gets the option type.booleanTests whether the option is selected by default.static intParses an option type from a string.toString()Overrides Object.toString() to ease debugging.
-
Field Details
-
BOOL
public static final int BOOLBoolean option.- See Also:
-
NONNEGATIVE_REAL
public static final int NONNEGATIVE_REALPositive real number.- See Also:
-
-
Constructor Details
-
OptionDescriptor
public OptionDescriptor(String name, String invname, int type, String desc, String[] disable, String[] enable, String[] deselect) Creates an option.- Parameters:
name- the option nameinvname- the inverse option name if the default state is on,nullotherwisetype- the typedesc- the descriptiondisable- array of options to disableenable- array of options to enabledeselect- array of options to deselect
-
-
Method Details
-
getName
Gets the option name.- Returns:
- the option name
-
getInverseName
Gets the inverse option name.- Returns:
- the option name
-
isDefaultSelected
public boolean isDefaultSelected()Tests whether the option is selected by default. The option is selected by default if there is an inverse option.- Returns:
trueif the option is selected by default,falseotherwise
-
getType
public int getType()Gets the option type.- Returns:
- the option type
-
getDescription
Gets the description.- Returns:
- the description
-
getOptionsToDisable
Gets the options that must be switched off if this option is selected.- Returns:
- array of options to disable
-
getOptionsToEnable
Gets the options that must be switched off if this option is selected.- Returns:
- array of options to disable
-
getOptionsToDeselect
Gets the options that must be deselected if this option is selected.- Returns:
- array of options to switch off
-
parseType
Parses an option type from a string.- Parameters:
s- the string ("BOOL" or "NONNEGATIVE_REAL")- Returns:
- the type
-
toString
Overrides Object.toString() to ease debugging. Returns a string consisting of the classname (without the package name!), the at-sign character `@', the unsigned hexadecimal representation of the hash code of the object and the option name in square brackets.
-