net.sf.freecol.client.gui.panel
Class ChoiceItem

java.lang.Object
  extended by net.sf.freecol.client.gui.panel.ChoiceItem

public class ChoiceItem
extends java.lang.Object

Can be used as a single choice for the choice dialog.


Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String LICENSE
           
static java.lang.String REVISION
           
 
Constructor Summary
ChoiceItem(java.lang.String text, int choice)
          Creates a new ChoiceItem with the object beeing a new Integer(choice).
ChoiceItem(java.lang.String text, java.lang.Object object)
          Creates a new ChoiceItem with the given object.
 
Method Summary
 int getChoice()
          Gets the choice as an int.
 java.lang.Object getObject()
          Gets the Object contained by this choice.
 java.lang.String toString()
          Gets a textual presentation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

LICENSE

public static final java.lang.String LICENSE
See Also:
Constant Field Values

REVISION

public static final java.lang.String REVISION
See Also:
Constant Field Values
Constructor Detail

ChoiceItem

public ChoiceItem(java.lang.String text,
                  int choice)
Creates a new ChoiceItem with the object beeing a new Integer(choice).

Parameters:
text - The text that should be used to represent this choice.
choice - An int identifying this choice.

ChoiceItem

public ChoiceItem(java.lang.String text,
                  java.lang.Object object)
Creates a new ChoiceItem with the given object.

Parameters:
text - The text that should be used to represent this choice.
object - The Object contained by this choice.
Method Detail

getObject

public java.lang.Object getObject()
Gets the Object contained by this choice.

Returns:
The Object.

getChoice

public int getChoice()
Gets the choice as an int.

Returns:
The number representing this object.
Throws:
java.lang.ClassCastException - if the object is not an Integer.

toString

public java.lang.String toString()
Gets a textual presentation of this object.

Overrides:
toString in class java.lang.Object
Returns:
The text set in the constructor.