Package hec.heclib.util
Class HecIntParam
java.lang.Object
hec.heclib.util.HecIntParam
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final double[]
_factors are conversion factors.
0.0, // INVALID_PARAMETER
1.0, // NON_DIMENSIONAL
25.40000, // LENGTH_SHORT inches and milimeters
0.30480, // LENGTH_MEDIUM feet and meters
1.609344, // LENGTH_LONG miles and kilometers
0.09290304, // AREA_SMALL sq ft and sq meters
2.589988, // AREA_LARGE sq miles and sq kilometers
0.028316847, // VOLUME_SMALL cubic ft and cubic meters
1.2335, // VOLUME_LARGE acre-ft and Thousands of cubic meters
0.010933196 // VOLUME_PER_AREA cfs/sq mi and cms/sq kmprotected int
_unit is the unit for the parameter and holds an integer value.protected String
_type is the type of unit system.protected int
_value holds the value for the parameterprotected String
paramName is used as the hash key to the paramData -
Constructor Summary
ConstructorsConstructorDescriptionHecIntParam
(String paramName) This constuctor uses the default values.HecIntParam
(String paramName, int value, String unitSystem, int unit) This constuctor uses the parameter name, value, unit system, and the unit to initialize the object -
Method Summary
Modifier and TypeMethodDescriptiondouble
getMax()
getMax() returns the maxminum value of the parameterdouble
getMin()
getMin() returns the minimum value of the parametergetParamName() returns the name of the parameter.double
getRecMax() returns the recommended maximum value of the parameterdouble
getRecMin() returns the recommended minimum value of the parameterint
getUnit()
int
getValue()
int
get the value in a specific unit system without changing the internal unit representation.int
isInRange() returns an integervoid
setUnit
(int pu) set the parameter unitvoid
setValue
(int v) set the valuevoid
set the parameter public void setParam(HecDoubleParamData d) { _data = d; }void
toString()
-
Field Details
-
_value
protected int _value_value holds the value for the parameter -
paramName
paramName is used as the hash key to the paramData -
_unitSystem
_type is the type of unit system.
Valid values are "English" and "SI" -
_unit
protected int _unit_unit is the unit for the parameter and holds an integer value.
INVALID_PARAMETER = 0;
NON_DIMENSIONAL = 1;
ENGTH_SHORT = 2; inches and milimeters
LENGTH_MEDIUM = 3; feet and meters
LENGTH_LONG = 4; miles and kilometers
AREA_SMALL = 5; sq ft and sq m
AREA_LARGE = 6; sq miles and sq kilometers
VOLUME_SMALL = 7; cubic ft and cubic meters
VOLUME_LARGE = 8; acre-ft and Thousands of cubic meters
VOLUME_PER_AREA = 9; cfs/sq mi and cms/sq km -
_factors
protected static final double[] _factors_factors are conversion factors.
0.0, // INVALID_PARAMETER
1.0, // NON_DIMENSIONAL
25.40000, // LENGTH_SHORT inches and milimeters
0.30480, // LENGTH_MEDIUM feet and meters
1.609344, // LENGTH_LONG miles and kilometers
0.09290304, // AREA_SMALL sq ft and sq meters
2.589988, // AREA_LARGE sq miles and sq kilometers
0.028316847, // VOLUME_SMALL cubic ft and cubic meters
1.2335, // VOLUME_LARGE acre-ft and Thousands of cubic meters
0.010933196 // VOLUME_PER_AREA cfs/sq mi and cms/sq km
-
-
Constructor Details
-
HecIntParam
This constuctor uses the default values. _value = 0
_unit = 0
_unitSystem = "SI" -
HecIntParam
This constuctor uses the parameter name, value, unit system, and the unit to initialize the object
-
-
Method Details
-
isInRange
public int isInRange()isInRange() returns an integer- Returns:
- 0 means the value is out of range
1 means the value is within the minimum and maximum range
2 means the value is within the recommended range
-
getMin
public double getMin()getMin() returns the minimum value of the parameter -
getMax
public double getMax()getMax() returns the maxminum value of the parameter -
getRecMin
public double getRecMin()getRecMin() returns the recommended minimum value of the parameter -
getRecMax
public double getRecMax()getRecMax() returns the recommended maximum value of the parameter -
getParamName
getParamName() returns the name of the parameter. -
setValue
set the parameter public void setParam(HecDoubleParamData d) { _data = d; } -
setValue
-
setValue
public void setValue(int v) set the value -
setUnit
public void setUnit(int pu) set the parameter unit- See Also:
-
getValue
get the value in a specific unit system without changing the internal unit representation. -
getValue
public int getValue() -
getUnitSystem
-
getUnit
public int getUnit() -
toString
-