cz.zcu.fav.kiv.editor.beans.parameters
Class UnitParam
java.lang.Object
java.util.Observable
cz.zcu.fav.kiv.editor.beans.types.Unit
cz.zcu.fav.kiv.editor.beans.parameters.UnitParam
- All Implemented Interfaces:
- java.lang.Cloneable
public class UnitParam
- extends Unit
The UnitParam
class represents a unit of parameter type.
- Version:
- 1.0, 05/2007
- Author:
- Marta Vaclavikova
Constructor Summary |
UnitParam(java.util.List<java.lang.String> unitList,
Parameter parameter)
|
UnitParam(java.lang.String value,
java.util.List<java.lang.String> unitList,
Parameter parameter)
Initializes a newly created UnitParam with the specified value, predefined
units and reference to the appropriate parameter. |
Method Summary |
void |
changeValue(java.lang.String value)
Sets the new value of unit and marks its parameter as chosen. |
void |
setDefault()
Sets the default value of the unit - assignes the default value to the main value and notifies its observers. |
void |
updateValue()
Sets the new value of unit and notifies its observers. |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UnitParam
public UnitParam(java.lang.String value,
java.util.List<java.lang.String> unitList,
Parameter parameter)
- Initializes a newly created
UnitParam
with the specified value, predefined
units and reference to the appropriate parameter. The value
argument is the
value of the unit. The unitList
is a list of predefined units. The
parameter
argument is an appropriate parameter.
- Parameters:
value
- a value of the unit.unitList
- a list of predefined units.parameter
- a reference to the unit parameter.
UnitParam
public UnitParam(java.util.List<java.lang.String> unitList,
Parameter parameter)
updateValue
public void updateValue()
- Sets the new value of unit and notifies its observers.
- Specified by:
updateValue
in class Unit
changeValue
public void changeValue(java.lang.String value)
- Sets the new value of unit and marks its parameter as chosen.
- Specified by:
changeValue
in class Unit
- Parameters:
value
- a new value of the unit.
setDefault
public void setDefault()
- Sets the default value of the unit - assignes the default value to the main value and notifies its observers.
- Overrides:
setDefault
in class Unit