rails.game.model
Class MoneyModel
java.lang.Object
java.util.Observable
rails.game.model.ModelObject
rails.game.state.State
rails.game.state.IntegerState
rails.game.model.MoneyModel
- All Implemented Interfaces:
- StateI
public class MoneyModel
- extends IntegerState
Method Summary |
java.lang.String |
getText()
The object that is sent to the Observer along with a notification. |
void |
set(int value)
|
void |
setText(java.lang.String text)
Set a fixed text, which will override the money value
as long as it is not null and not "". |
Methods inherited from class java.util.Observable |
clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SUPPRESS_ZERO
public static final int SUPPRESS_ZERO
- See Also:
- Constant Field Values
SUPPRESS_INITIAL_ZERO
public static final int SUPPRESS_INITIAL_ZERO
- See Also:
- Constant Field Values
ADD_PLUS
public static final int ADD_PLUS
- See Also:
- Constant Field Values
ALLOW_NEGATIVE
public static final int ALLOW_NEGATIVE
- See Also:
- Constant Field Values
MoneyModel
public MoneyModel(java.lang.String name)
MoneyModel
public MoneyModel(java.lang.String name,
int value)
set
public void set(int value)
- Overrides:
set
in class IntegerState
setText
public void setText(java.lang.String text)
- Set a fixed text, which will override the money value
as long as it is not null and not "".
- Parameters:
text
-
getText
public java.lang.String getText()
- Description copied from class:
ModelObject
- The object that is sent to the Observer along with a notification. The
default result is the Observable's toString(), but it can be overridden
where needed.
- Overrides:
getText
in class IntegerState
- Returns: