Package chemaxon.marvin.util
Class OptionDescriptor
- java.lang.Object
-
- chemaxon.marvin.util.OptionDescriptor
-
@PublicAPI public class OptionDescriptor extends Object
General option descriptor class.- Since:
- Marvin 5.0, 06/05/2007
-
-
Field Summary
Fields Modifier and Type Field Description static int
BOOL
Boolean option.static int
NONNEGATIVE_REAL
Positive real number.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDescription()
Gets the description.String
getInverseName()
Gets the inverse option name.String
getName()
Gets the option name.String[]
getOptionsToDeselect()
Gets the options that must be deselected if this option is selected.String[]
getOptionsToDisable()
Gets the options that must be switched off if this option is selected.String[]
getOptionsToEnable()
Gets the options that must be switched off if this option is selected.int
getType()
Gets the option type.boolean
isDefaultSelected()
Tests whether the option is selected by default.static int
parseType(String s)
Parses an option type from a string.String
toString()
Overrides Object.toString() to ease debugging.
-
-
-
Field Detail
-
BOOL
public static final int BOOL
Boolean option.- See Also:
- Constant Field Values
-
NONNEGATIVE_REAL
public static final int NONNEGATIVE_REAL
Positive real number.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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,null
otherwisetype
- the typedesc
- the descriptiondisable
- array of options to disableenable
- array of options to enabledeselect
- array of options to deselect
-
-
Method Detail
-
getName
public String getName()
Gets the option name.- Returns:
- the option name
-
getInverseName
public String 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:
true
if the option is selected by default,false
otherwise
-
getType
public int getType()
Gets the option type.- Returns:
- the option type
-
getDescription
public String getDescription()
Gets the description.- Returns:
- the description
-
getOptionsToDisable
public String[] getOptionsToDisable()
Gets the options that must be switched off if this option is selected.- Returns:
- array of options to disable
-
getOptionsToEnable
public String[] getOptionsToEnable()
Gets the options that must be switched off if this option is selected.- Returns:
- array of options to disable
-
getOptionsToDeselect
public String[] getOptionsToDeselect()
Gets the options that must be deselected if this option is selected.- Returns:
- array of options to switch off
-
parseType
public static int parseType(String s)
Parses an option type from a string.- Parameters:
s
- the string ("BOOL" or "NONNEGATIVE_REAL")- Returns:
- the type
-
toString
public String 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.
-
-