net.sf.freecol.common.option
Interface Option<T>

All Superinterfaces:
java.lang.Cloneable
All Known Implementing Classes:
AboutAction, AbstractOption, AbstractUnitOption, ActionManager, AssignTradeRouteAction, AudioMixerOption, BooleanOption, BuildColonyAction, CenterAction, ChangeAction, ChangeWindowedModeAction, ChatAction, ClearOrdersAction, ClientOptions, ColopediaAction, ContinueAction, DebugAction, DeclareIndependenceAction, DetermineHighSeasAction, DisbandUnitAction, DisplayBordersAction, DisplayGridAction, DisplayTileTextAction, EndTurnAction, EuropeAction, ExecuteGotoOrdersAction, FileOption, FindSettlementAction, FortifyAction, FreeColAction, GotoAction, GotoTileAction, ImprovementAction, IntegerOption, LanguageOption, ListOption, LoadAction, MapboardAction, MapControlsAction, MapEditorAction, MiniMapZoomInAction, MiniMapZoomOutAction, ModListOption, ModOption, MoveAction, NewAction, NewEmptyMapAction, OpenAction, OptionGroup, PercentageOption, PreferencesAction, QuitAction, RangeOption, ReconnectAction, RenameAction, ReportCargoAction, ReportColonyAction, ReportContinentalCongressAction, ReportEducationAction, ReportExplorationAction, ReportForeignAction, ReportHighScoresAction, ReportHistoryAction, ReportIndianAction, ReportLabourAction, ReportMilitaryAction, ReportNavalAction, ReportProductionAction, ReportReligionAction, ReportRequirementsAction, ReportTradeAction, ReportTurnAction, RetireAction, SaveAction, SaveAndQuitAction, ScaleMapAction, SelectableAction, SelectOption, SentryAction, ShowDifficultyAction, ShowGameOptionsAction, ShowMainAction, ShowMapGeneratorOptionsAction, SkipUnitAction, StringOption, TilePopupAction, ToggleViewModeAction, TradeRouteAction, UnitAction, UnitListOption, UnitTypeOption, UnloadAction, WaitAction, ZoomInAction, ZoomOutAction

public interface Option<T>
extends java.lang.Cloneable

An option describes something which can be customized by the user.

See Also:
GameOptions

Method Summary
 Option<T> clone()
           
 java.lang.String getId()
          Returns the id of this Option.
 T getValue()
          Returns the value of this Option.
 void readFromXML(javax.xml.stream.XMLStreamReader in)
          Initializes this object from an XML-representation of this object.
 void setValue(T value)
          Sets the value of this Option.
 java.lang.String toString()
          Returns a textual representation of this object.
 void toXML(javax.xml.stream.XMLStreamWriter out)
          Makes an XML-representation of this object.
 

Method Detail

toString

java.lang.String toString()
Returns a textual representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
The name of this Option.

getId

java.lang.String getId()
Returns the id of this Option.

Returns:
The unique identifier as provided in the constructor.

getValue

T getValue()
Returns the value of this Option.

Returns:
the value of this Option

setValue

void setValue(T value)
Sets the value of this Option.

Parameters:
value - the value of this Option

clone

Option<T> clone()
                throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException

readFromXML

void readFromXML(javax.xml.stream.XMLStreamReader in)
                 throws javax.xml.stream.XMLStreamException
Initializes this object from an XML-representation of this object.

Parameters:
in - The input stream with the XML.
Throws:
javax.xml.stream.XMLStreamException - if there are any problems writing to the stream.

toXML

void toXML(javax.xml.stream.XMLStreamWriter out)
           throws javax.xml.stream.XMLStreamException
Makes an XML-representation of this object.

Parameters:
out - The output stream.
Throws:
javax.xml.stream.XMLStreamException - if there are any problems writing to the stream.