megamek.common.options
Class AbstractOptions

java.lang.Object
  extended by megamek.common.options.AbstractOptions
All Implemented Interfaces:
java.io.Serializable, IOptions
Direct Known Subclasses:
GameOptions, PilotOptions, Quirks, WeaponQuirks

public abstract class AbstractOptions
extends java.lang.Object
implements IOptions, java.io.Serializable

Parent class for options settings

See Also:
Serialized Form

Nested Class Summary
protected  class AbstractOptions.GroupsEnumeration
           
 
Constructor Summary
protected AbstractOptions()
           
 
Method Summary
protected  IBasicOptionGroup addGroup(java.lang.String groupName)
           
protected  IBasicOptionGroup addGroup(java.lang.String groupName, java.lang.String key)
           
protected  void addOption(IBasicOptionGroup group, java.lang.String name, boolean defaultValue)
           
protected  void addOption(IBasicOptionGroup group, java.lang.String name, float defaultValue)
           
protected  void addOption(IBasicOptionGroup group, java.lang.String name, int defaultValue)
           
protected  void addOption(IBasicOptionGroup group, java.lang.String name, int type, java.lang.Object defaultValue)
           
protected  void addOption(IBasicOptionGroup group, java.lang.String name, java.lang.String defaultValue)
           
protected  void addOption(IBasicOptionGroup group, java.lang.String name, java.util.Vector<java.lang.String> defaultValue)
           
 boolean booleanOption(java.lang.String name)
          Returns the value of the desired option as the boolean
 float floatOption(java.lang.String name)
          Returns the value of the desired option as the float
 java.util.Enumeration<IOptionGroup> getGroups()
          Returns the Enumeration of the option groups in this options container.
 IOption getOption(java.lang.String name)
          Returns the option by name or null if there is no such option
 IOptionInfo getOptionInfo(java.lang.String name)
          Returns the UI specific data to allow the user to set the option
 java.util.Enumeration<IOption> getOptions()
          Returns the Enumeration of the options in this options container.
(package private)  IOptionsInfo getOptionsInfo()
           
protected abstract  AbstractOptionsInfo getOptionsInfoImp()
           
protected abstract  void initialize()
           
 int intOption(java.lang.String name)
          Returns the value of the desired option as the int
 java.lang.String stringOption(java.lang.String name)
          Returns the value of the desired option as the String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractOptions

protected AbstractOptions()
Method Detail

initialize

protected abstract void initialize()

getGroups

public java.util.Enumeration<IOptionGroup> getGroups()
Description copied from interface: IOptions
Returns the Enumeration of the option groups in this options container.

Specified by:
getGroups in interface IOptions
Returns:
Enumeration of the IOptionGroup

getOptions

public java.util.Enumeration<IOption> getOptions()
Description copied from interface: IOptions
Returns the Enumeration of the options in this options container. The order of options is not specified.

Specified by:
getOptions in interface IOptions
Returns:
Enumeration of the IOption

getOptionInfo

public IOptionInfo getOptionInfo(java.lang.String name)
Description copied from interface: IOptions
Returns the UI specific data to allow the user to set the option

Specified by:
getOptionInfo in interface IOptions
Parameters:
name - option name
Returns:
UI specific data
See Also:
IOptionInfo

getOption

public IOption getOption(java.lang.String name)
Description copied from interface: IOptions
Returns the option by name or null if there is no such option

Specified by:
getOption in interface IOptions
Parameters:
name - option name
Returns:
the option or null if there is no such option

booleanOption

public boolean booleanOption(java.lang.String name)
Description copied from interface: IOptions
Returns the value of the desired option as the boolean

Specified by:
booleanOption in interface IOptions
Parameters:
name - option name
Returns:
the value of the desired option as the boolean

intOption

public int intOption(java.lang.String name)
Description copied from interface: IOptions
Returns the value of the desired option as the int

Specified by:
intOption in interface IOptions
Parameters:
name - option name
Returns:
the value of the desired option as the int

floatOption

public float floatOption(java.lang.String name)
Description copied from interface: IOptions
Returns the value of the desired option as the float

Specified by:
floatOption in interface IOptions
Parameters:
name - option name
Returns:
the value of the desired option as the float

stringOption

public java.lang.String stringOption(java.lang.String name)
Description copied from interface: IOptions
Returns the value of the desired option as the String

Specified by:
stringOption in interface IOptions
Parameters:
name - option name
Returns:
the value of the desired option as the String

getOptionsInfo

IOptionsInfo getOptionsInfo()

getOptionsInfoImp

protected abstract AbstractOptionsInfo getOptionsInfoImp()

addGroup

protected IBasicOptionGroup addGroup(java.lang.String groupName)

addGroup

protected IBasicOptionGroup addGroup(java.lang.String groupName,
                                     java.lang.String key)

addOption

protected void addOption(IBasicOptionGroup group,
                         java.lang.String name,
                         java.lang.String defaultValue)

addOption

protected void addOption(IBasicOptionGroup group,
                         java.lang.String name,
                         boolean defaultValue)

addOption

protected void addOption(IBasicOptionGroup group,
                         java.lang.String name,
                         int defaultValue)

addOption

protected void addOption(IBasicOptionGroup group,
                         java.lang.String name,
                         float defaultValue)

addOption

protected void addOption(IBasicOptionGroup group,
                         java.lang.String name,
                         java.util.Vector<java.lang.String> defaultValue)

addOption

protected void addOption(IBasicOptionGroup group,
                         java.lang.String name,
                         int type,
                         java.lang.Object defaultValue)