public class UnitAttr extends Unit
UnitAttr
class represents a unit of attribute type.Modifier and Type | Field and Description |
---|---|
protected Attribute |
attribute
The reference to the attribute of the unit
|
protected java.lang.String |
temporaryValue
The temporary value of the attribute unit
|
defaultValue, value, valueList
Constructor and Description |
---|
UnitAttr(java.util.List<java.lang.String> unitList) |
UnitAttr(java.lang.String value,
java.util.List<java.lang.String> unitList)
Initializes a newly created
UnitAttr with the specified value and predefined
units. |
Modifier and Type | Method and Description |
---|---|
void |
changeValue(java.lang.String value)
Sets the new value of unit and marks its attribute as chosen.
|
void |
setAttribute(Attribute attribute) |
void |
setDefault()
Sets the
default and temporary value of the unit. |
void |
setValuesFromTemporary()
Sets values of the unit after its temporary value.
|
void |
updateValue()
Sets the new temporary value of unit.
|
assignDefaultFromValue, clone, getDefaultValue, getValue, getValueList, setDefaultValue, setValue, setValueList
protected java.lang.String temporaryValue
protected Attribute attribute
public UnitAttr(java.lang.String value, java.util.List<java.lang.String> unitList)
UnitAttr
with the specified value and predefined
units. The value
argument is the value of the unit. The unitList
is a list of predefined units.value
- a value of the unit.unitList
- a list of predefined units.public UnitAttr(java.util.List<java.lang.String> unitList)
public void changeValue(java.lang.String value)
changeValue
in class Unit
value
- a new value of the unit.public void updateValue()
updateValue
in class Unit
public void setValuesFromTemporary()
public void setAttribute(Attribute attribute)
public void setDefault()
default and temporary value
of the unit.setDefault
in class Unit