cz.zcu.fav.kiv.editor.beans.types
Class Unit

java.lang.Object
  extended by java.util.Observable
      extended by cz.zcu.fav.kiv.editor.beans.types.Unit
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
UnitAttr, UnitParam

public abstract class Unit
extends java.util.Observable
implements java.lang.Cloneable

The Unit class represents a parent for unit of elements.

Version:
1.0, 05/2007
Author:
Marta Vaclavikova

Field Summary
protected  java.lang.String defaultValue
          The default value of the unit
protected  java.lang.String value
          The value of the unit
protected  java.util.List<java.lang.String> valueList
          The list of predefined values of the unit
 
Constructor Summary
Unit(java.util.List<java.lang.String> unitList)
           
Unit(java.lang.String value, java.util.List<java.lang.String> unitList)
          Initializes a newly created Unit with the specified value and predefined units.
 
Method Summary
 void assignDefaultFromValue()
          Assigns the default value from value.
abstract  void changeValue(java.lang.String value)
           
 java.lang.Object clone()
           
 java.lang.String getDefaultValue()
           
 java.lang.String getValue()
           
 java.util.List<java.lang.String> getValueList()
           
 void setDefault()
          Sets the default value of the unit - assignes the default value to the main value.
 void setDefaultValue(java.lang.String defaultValue)
           
 void setValue(java.lang.String value)
           
 void setValueList(java.util.List<java.lang.String> values)
           
abstract  void updateValue()
           
 
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
 

Field Detail

value

protected java.lang.String value
The value of the unit


defaultValue

protected java.lang.String defaultValue
The default value of the unit


valueList

protected java.util.List<java.lang.String> valueList
The list of predefined values of the unit

Constructor Detail

Unit

public Unit(java.lang.String value,
            java.util.List<java.lang.String> unitList)
Initializes a newly created Unit with the specified value and predefined units. The value argument is the value of the unit. The unitList is a list of predefined units.

Parameters:
value - a value of the unit.
unitList - a list of predefined units.

Unit

public Unit(java.util.List<java.lang.String> unitList)
Method Detail

getDefaultValue

public java.lang.String getDefaultValue()

setDefaultValue

public void setDefaultValue(java.lang.String defaultValue)

setDefault

public void setDefault()
Sets the default value of the unit - assignes the default value to the main value.


getValue

public java.lang.String getValue()

updateValue

public abstract void updateValue()

changeValue

public abstract void changeValue(java.lang.String value)

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

assignDefaultFromValue

public void assignDefaultFromValue()
Assigns the default value from value.


getValueList

public java.util.List<java.lang.String> getValueList()

setValueList

public void setValueList(java.util.List<java.lang.String> values)

setValue

public void setValue(java.lang.String value)