Package hec.lang
Class UnitsType
java.lang.Object
java.util.Observable
hec.lang.NamedType
hec.lang.UnitsType
- All Implemented Interfaces:
AsciiSerializable
,FieldAccessor
,Serializable
,Cloneable
,Comparable
,Observer
,Modifiable
Describes the units system that is in use.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
A String describing current units system in use.protected int
An int identifying the current units in use.static final int
The constant for English units.static final int
The constant for SI units.Fields inherited from class hec.lang.NamedType
_description, _ignoreModifiedEvents, _index, _isValid, _modified, _name, defaultDescription, defaultName, DESCRIPTION_CHANGED, NAME_CHANGED, RENAME_EVENT
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs the default UnitsType as a default NamedType with the units system set as "SI Units" and the units type set as UNITS_SI.Constructs a default UnitsType with the system set to the String argument system, and the type set to the int argument type.Constructs a default UnitsType with the system set to the String argument system, and the type set to the int argument type. -
Method Summary
Modifier and TypeMethodDescriptionReturns a String describing the current units system.int
Returns an int identifying the current units type.void
setUnitsSystem
(String system) Sets the units system to the String argument.void
setUnitsType
(int type) Sets the units type to the int argument.Methods inherited from class hec.lang.NamedType
addModifiableListener, clone, compareTo, fireModifiedStateChanged, getDescription, getDisplayName, getFieldObject, getIgnoreModifiedEvents, getIndex, getName, isModified, isValid, readResolve, removeModifiableListener, rename, set, setDescription, setFieldObject, setIgnoreModifiedEvents, setIndex, setModified, setName, setValid, toString, update, useRecursiveModifiedTest
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Field Details
-
_unitsSystem
A String describing current units system in use. -
_unitsType
protected int _unitsTypeAn int identifying the current units in use. -
UNITS_ENGLISH
public static final int UNITS_ENGLISHThe constant for English units.- See Also:
-
UNITS_SI
public static final int UNITS_SIThe constant for SI units.- See Also:
-
-
Constructor Details
-
UnitsType
public UnitsType()Constructs the default UnitsType as a default NamedType with the units system set as "SI Units" and the units type set as UNITS_SI. -
UnitsType
Constructs a default UnitsType with the system set to the String argument system, and the type set to the int argument type. -
UnitsType
Constructs a default UnitsType with the system set to the String argument system, and the type set to the int argument type.
-
-
Method Details
-
setUnitsSystem
Sets the units system to the String argument. -
getUnitsSystem
Returns a String describing the current units system. -
setUnitsType
public void setUnitsType(int type) Sets the units type to the int argument. -
getUnitsType
public int getUnitsType()Returns an int identifying the current units type.
-