rails.game.model
Class CalculatedMoneyModel
java.lang.Object
java.util.Observable
rails.game.model.ModelObject
rails.game.model.CalculatedMoneyModel
public class CalculatedMoneyModel
- extends ModelObject
This class allows calculated values to be used as model objects by using
reflection. The value to be calculated is obtained by calling a method
specified by name. This method must return an Integer and may not have any
parameters.
- Author:
- Erik Vos
Method Summary |
protected int |
calculate()
|
java.lang.String |
getText()
The object that is sent to the Observer along with a notification. |
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, toString, wait, wait, wait |
SUPPRESS_ZERO
public static final int SUPPRESS_ZERO
- See Also:
- Constant Field Values
CalculatedMoneyModel
public CalculatedMoneyModel(java.lang.Object object,
java.lang.String methodName)
calculate
protected int calculate()
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.
- Specified by:
getText
in class ModelObject
- Returns: