Class HecDoubleParam

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

public class HecDoubleParam extends Object implements Serializable
This is HecDoubleParam
See Also:
  • Field Details

    • _value

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

      protected String paramName
    • UNIT_SYSTEMS

      public static final String[] UNIT_SYSTEMS
      Constants for unit systems.
    • UNITS_ENGLISH

      public static final int UNITS_ENGLISH
      English unit system constant index.
      See Also:
    • UNITS_SI

      public static final int UNITS_SI
      SI unit system constant index.
      See Also:
    • _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
    • _scales

      protected static final double[][][] _scales
    • FACTORS

      public static final String[] 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

      public HecDoubleParam(String paramName)
      This constuctor uses the default values
    • HecDoubleParam

      public HecDoubleParam(String paramName, HecDouble v, String unitSystem, int unit)
    • HecDoubleParam

      public HecDoubleParam(String paramName, double v, String unitSystem, int unit)
  • 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(HecDouble v, String unitSystem, int unit)
      set the parameter, value, and type
    • setValue

      public void setValue(HecDouble v, String unitSystem)
    • setValue

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

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

      public void setValue(HecDouble v)
      set the parameter and value
    • setValue

      public void setValue(double v)
    • setUnit

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

      public void setUnitSystem(String us)
    • getValue

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

      public HecDouble getValue(int unitsys)
    • getValue

      public double getValue()
    • getUnitSystem

      public String getUnitSystem()
    • getUnit

      public int getUnit()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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)