Package hec.heclib.util
Class HecDoubleParam
java.lang.Object
hec.heclib.util.HecDoubleParam
- All Implemented Interfaces:
Serializable
This is HecDoubleParam
- 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 static final double[][][]
protected int
_unit is the unit for the parameter and holds an integer value.protected String
_type is the type of unit system.protected HecDouble
_value holds the value for the parameterstatic final int
static final int
static final String[]
static final int
static final int
static final int
static final int
static final int
static final int
static final int
protected String
static final String[]
Constants for unit systems.static final int
English unit system constant index.static final int
SI unit system constant index.static final int
static final int
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionHecDoubleParam
(String paramName) This constuctor uses the default valuesHecDoubleParam
(String paramName, double v, String unitSystem, int unit) HecDoubleParam
(String paramName, HecDouble v, String unitSystem, int unit) -
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()
double
getValue()
getValue
(int unitsys) get the value in a specific unit system without changing the internal unit representation.int
isInRange() returns an integerstatic double
scaleUnits
(double argVal, int inUnitsize, int unitsys, int outUnitsize) void
setUnit
(int pu) set the parameter unitvoid
setUnitSystem
(String us) void
setValue
(double v) void
void
set the parameter and valuevoid
void
set the parameter, value, and typevoid
toString()
static double
translateUnits
(double argVal, int unitsize, int inUnitsys, int outUnitsys)
-
Field Details
-
_value
_value holds the value for the parameter -
paramName
-
UNIT_SYSTEMS
Constants for unit systems. -
UNITS_ENGLISH
public static final int UNITS_ENGLISHEnglish unit system constant index.- See Also:
-
UNITS_SI
public static final int UNITS_SISI unit system constant index.- See Also:
-
_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 -
_scales
protected static final double[][][] _scales -
FACTORS
-
INVALID_PARAMETER
public static final int INVALID_PARAMETER- See Also:
-
NON_DIMENSIONAL
public static final int NON_DIMENSIONAL- See Also:
-
LENGTH_SHORT
public static final int LENGTH_SHORT- See Also:
-
LENGTH_MEDIUM
public static final int LENGTH_MEDIUM- See Also:
-
LENGTH_LONG
public static final int LENGTH_LONG- See Also:
-
AREA_SMALL
public static final int AREA_SMALL- See Also:
-
AREA_LARGE
public static final int AREA_LARGE- See Also:
-
VOLUME_SMALL
public static final int VOLUME_SMALL- See Also:
-
VOLUME_LARGE
public static final int VOLUME_LARGE- See Also:
-
VOLUME_PER_AREA
public static final int VOLUME_PER_AREA- See Also:
-
FLOW_SMALL
public static final int FLOW_SMALL- See Also:
-
FLOW_LARGE
public static final int FLOW_LARGE- See Also:
-
-
Constructor Details
-
HecDoubleParam
This constuctor uses the default values -
HecDoubleParam
-
HecDoubleParam
-
-
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, value, and type -
setValue
-
setValue
-
setValue
-
setValue
set the parameter and value -
setValue
public void setValue(double v) -
setUnit
public void setUnit(int pu) set the parameter unit- See Also:
-
setUnitSystem
-
getValue
get the value in a specific unit system without changing the internal unit representation. -
getValue
-
getValue
public double getValue() -
getUnitSystem
-
getUnit
public int getUnit() -
toString
-
translateUnits
public static double translateUnits(double argVal, int unitsize, int inUnitsys, int outUnitsys) -
scaleUnits
public static double scaleUnits(double argVal, int inUnitsize, int unitsys, int outUnitsize)
-