Class HecIntParam

java.lang.Object
hec.heclib.util.HecIntParam
All Implemented Interfaces:
Serializable

public class HecIntParam extends Object implements Serializable
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected 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 km
    protected 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 parameter
    protected String
    paramName is used as the hash key to the paramData
  • Constructor Summary

    Constructors
    Constructor
    Description
    HecIntParam(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 Type
    Method
    Description
    double
    getMax() returns the maxminum value of the parameter
    double
    getMin() returns the minimum value of the parameter
    getParamName() returns the name of the parameter.
    double
    getRecMax() returns the recommended maximum value of the parameter
    double
    getRecMin() returns the recommended minimum value of the parameter
    int
     
     
    int
     
    int
    get the value in a specific unit system without changing the internal unit representation.
    int
    isInRange() returns an integer
    void
    setUnit(int pu)
    set the parameter unit
    void
    setValue(int v)
    set the value
    void
    setValue(int v, String unitSystem, int unit)
    set the parameter public void setParam(HecDoubleParamData d) { _data = d; }
    void
    setValue(String s, int v, String unitSystem, int unit)
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • _value

      protected int _value
      _value holds the value for the parameter
    • paramName

      protected String paramName
      paramName is used as the hash key to the paramData
    • _unitSystem

      protected String _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

      public HecIntParam(String paramName)
      This constuctor uses the default values. _value = 0
      _unit = 0
      _unitSystem = "SI"
    • HecIntParam

      public 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 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

      public String getParamName()
      getParamName() returns the name of the parameter.
    • setValue

      public void setValue(int v, String unitSystem, int unit)
      set the parameter public void setParam(HecDoubleParamData d) { _data = d; }
    • setValue

      public void setValue(String s, int v, String unitSystem, int unit)
    • setValue

      public void setValue(int v)
      set the value
    • setUnit

      public void setUnit(int pu)
      set the parameter unit
      See Also:
    • getValue

      public int getValue(String s)
      get the value in a specific unit system without changing the internal unit representation.
    • getValue

      public int getValue()
    • getUnitSystem

      public String getUnitSystem()
    • getUnit

      public int getUnit()
    • toString

      public String toString()
      Overrides:
      toString in class Object