chemaxon.marvin.util
Class OptionDescriptor

java.lang.Object
  extended by chemaxon.marvin.util.OptionDescriptor

public class OptionDescriptor
extends java.lang.Object

General option descriptor class.

Since:
Marvin 5.0, 06/05/2007
Version:
5.0, 06/05/2007
Author:
Peter Csizmadia

Field Summary
static int BOOL
          Boolean option.
static int NONNEGATIVE_REAL
          Positive real number.
 
Constructor Summary
OptionDescriptor(java.lang.String name, java.lang.String invname, int type, java.lang.String desc, java.lang.String[] disable, java.lang.String[] enable, java.lang.String[] deselect)
          Creates an option.
 
Method Summary
 java.lang.String getDescription()
          Gets the description.
 java.lang.String getInverseName()
          Gets the inverse option name.
 java.lang.String getName()
          Gets the option name.
 java.lang.String[] getOptionsToDeselect()
          Gets the options that must be deselected if this option is selected.
 java.lang.String[] getOptionsToDisable()
          Gets the options that must be switched off if this option is selected.
 java.lang.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(java.lang.String s)
          Parses an option type from a string.
 java.lang.String toString()
          Overrides Object.toString() to ease debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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(java.lang.String name,
                        java.lang.String invname,
                        int type,
                        java.lang.String desc,
                        java.lang.String[] disable,
                        java.lang.String[] enable,
                        java.lang.String[] deselect)
Creates an option.

Parameters:
name - the option name
invname - the inverse option name if the default state is on, null otherwise
type - the type
desc - the description
disable - array of options to disable
enable - array of options to enable
deselect - array of options to deselect
Method Detail

getName

public java.lang.String getName()
Gets the option name.

Returns:
the option name

getInverseName

public java.lang.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 java.lang.String getDescription()
Gets the description.

Returns:
the description

getOptionsToDisable

public java.lang.String[] getOptionsToDisable()
Gets the options that must be switched off if this option is selected.

Returns:
array of options to disable

getOptionsToEnable

public java.lang.String[] getOptionsToEnable()
Gets the options that must be switched off if this option is selected.

Returns:
array of options to disable

getOptionsToDeselect

public java.lang.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(java.lang.String s)
Parses an option type from a string.

Parameters:
s - the string ("BOOL" or "NONNEGATIVE_REAL")
Returns:
the type

toString

public java.lang.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.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object