megamek.common.options
Interface IOption

All Superinterfaces:
IBasicOption, IOptionInfo
All Known Implementing Classes:
Option

public interface IOption
extends IBasicOption, IOptionInfo

Interface of the settable option. The settable option is used for game options which relate to game behavior and as well as pilot options which relate to specific stats about a pilot, such as advantages. Game options are the same across all clients. A settable option's primary purpose is to store a value for the option. Its secondary purpose is to give the desired options dialog enough data to allow the user to set the option.

Version:
Author:
Ben

Field Summary
static int BOOLEAN
          Booolean option type
static int CHOICE
          Choise option type
static int FLOAT
          Float option type
static int INTEGER
          Integer option type
static int STRING
          String option type
 
Method Summary
 boolean booleanValue()
          Return the value as the boolean
 void clearValue()
          Resets the value to its "default" state
 float floatValue()
          Return the value as the float
 java.lang.Object getDefault()
          Returns default option value
 IOptions getOwner()
          Returns this option container - GameOptions, PilotOptions etc
 int getType()
          Returns option type.
 int intValue()
          Return the value as the int
 void setValue(boolean value)
          Sets the boolean value
 void setValue(float value)
          Sets the float value
 void setValue(int value)
          Sets the int value
 void setValue(java.lang.Object value)
          Sets the value
 void setValue(java.lang.String value)
          Sets the String value
 java.lang.String stringValue()
          Return the value as the String
 
Methods inherited from interface megamek.common.options.IBasicOption
getName, getValue
 
Methods inherited from interface megamek.common.options.IOptionInfo
getDescription, getDisplayableName, getDisplayableNameWithValue, getTextFieldLength, isLabelBeforeTextField
 

Field Detail

BOOLEAN

static final int BOOLEAN
Booolean option type

See Also:
Constant Field Values

INTEGER

static final int INTEGER
Integer option type

See Also:
Constant Field Values

FLOAT

static final int FLOAT
Float option type

See Also:
Constant Field Values

STRING

static final int STRING
String option type

See Also:
Constant Field Values

CHOICE

static final int CHOICE
Choise option type

See Also:
Constant Field Values
Method Detail

getOwner

IOptions getOwner()
Returns this option container - GameOptions, PilotOptions etc

Returns:
option container

getType

int getType()
Returns option type.

Returns:
option type
See Also:
etc

getDefault

java.lang.Object getDefault()
Returns default option value

Returns:
default option value

booleanValue

boolean booleanValue()
Return the value as the boolean


intValue

int intValue()
Return the value as the int


floatValue

float floatValue()
Return the value as the float


stringValue

java.lang.String stringValue()
Return the value as the String


setValue

void setValue(java.lang.Object value)
Sets the value

Parameters:
value - value to set

setValue

void setValue(java.lang.String value)
Sets the String value

Parameters:
value - value to set

setValue

void setValue(boolean value)
Sets the boolean value

Parameters:
value - value to set

setValue

void setValue(int value)
Sets the int value

Parameters:
value - value to set

setValue

void setValue(float value)
Sets the float value

Parameters:
value - value to set

clearValue

void clearValue()
Resets the value to its "default" state