Package hec.data
Class Units
java.lang.Object
hec.data.AbstractDataSet
hec.data.Units
- All Implemented Interfaces:
Serializable
Deprecated.
This class is deprecated as most of the functionality is delegated to the hec-nucleus-metadata version of the class
Notably the functions missing from hec-nucleus-metadata are ones that reference hec.io package classes that will need to find a new home
when dependencies are managed.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Deprecated.static final int
Deprecated.static final String
Deprecated.static final String
Deprecated.static final int
Deprecated.static final int
Deprecated.static final String
Deprecated.Fields inherited from class hec.data.AbstractDataSet
subFieldDelimiter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
canConvertBetweenUnits
(String fromUnits, String toUnits) Deprecated.static void
convertUnits
(double[] x, int paramID, int fromUnitSystem, int toUnitSystem) Deprecated.Converts an array from one unit system to another.static int
convertUnits
(double[] data, int number, int fromUnitSyst, int toUnitSyst, stringContainer units) Deprecated.static void
convertUnits
(double[] x, String fromUnits, String toUnits) Deprecated.static double
convertUnits
(double x, int paramID, int fromUnitSystem, int toUnitSystem) Deprecated.Converts a value from one unit system to another.static double
convertUnits
(double x, String fromUnits, String toUnits) Deprecated.static ParamDoubleArray
convertUnits
(ParamDoubleArray x, String fromUnits, String toUnits) Deprecated.static ParamDouble
convertUnits
(ParamDouble x, String fromUnits, String toUnits) Deprecated.static int
convertUnits
(DataContainer container, int toUnitSyst) Deprecated.static int
convertUnits
(PairedDataContainer container, int toUnitSyst) Deprecated.static int
convertUnits
(TimeSeriesContainer container, int toUnitSyst) Deprecated.static void
convertUnits
(List<Object> containers, int toUnitSyst) Deprecated.boolean
Deprecated.static String[]
getAliasesForUnits
(String units) Deprecated.getAllUnitsThatCanConvertTo
(String unit, String unitSystem) Deprecated.Returns an ArrayList of all units that can convert to the given unit.static String[]
Deprecated.static String
getBestMatch
(String units) Deprecated.static double
getScalarFactor
(String fromUnits, String toUnits) Deprecated.Does a lookup to find a scalar factor that converts between the two units.static double
getStorageToFlowConversion
(String storageUnits, String flowUnits) Deprecated.Interpret unit strings for storage and flow to develop scale factor to convert storage units (ac-ft, m3) to flow units (cfs, cms).static String
getUnitsForAlias
(String alias) Deprecated.static String
getUnitsInUnitSystem
(String unitsSystem, String unitsFrom) Deprecated.mil.army.usace.hec.metadata.Units
Deprecated.static String
getUnitsStringForUnitsId
(int unitsId) Deprecated.return the Units String (ENGLISH, SI, UNDEFINED_UNITS
) for the Units Id (ENGLISH_ID, SI_ID, UNDEF_ID
)static int
getUnitSystemForUnits
(String unitStr) Deprecated.Static method whichs takes a unit label and attempts to find the matching unit systemboolean
Deprecated.static boolean
isUnitsInAlias
(String units, String aliasUnits) Deprecated.This method returns true if the if the given units is contained in the list of aliases for the given aliasUnits or exactly matches the given aliasUnits.static boolean
isValidUnitsSystem
(int system) Deprecated.void
Deprecated.void
Deprecated.Sets the units string for this Unit object.toString()
Deprecated.Methods inherited from class hec.data.AbstractDataSet
sdfFULL
-
Field Details
-
UNDEFINED_UNITS
Deprecated.- See Also:
-
UNDEF_ID
public static final int UNDEF_IDDeprecated.- See Also:
-
SI
Deprecated.- See Also:
-
SI_ID
public static final int SI_IDDeprecated.- See Also:
-
ENGLISH_ID
public static final int ENGLISH_IDDeprecated.- See Also:
-
ENGLISH
Deprecated.- See Also:
-
ERROR_VALID_UNIT_SYSTEMS
Deprecated.- See Also:
-
-
Constructor Details
-
Units
Deprecated.- Throws:
DataSetIllegalArgumentException
-
Units
public Units()Deprecated. -
Units
Deprecated. -
Units
Deprecated.Copy constructor -
Units
public Units(mil.army.usace.hec.metadata.Units units) Deprecated.
-
-
Method Details
-
setUnits
Deprecated. -
getUnitsForAlias
Deprecated. -
setUnits
Deprecated.Sets the units string for this Unit object. Checks for any aliases first. If no alias is defined and useBestMatch is true, will try to find the units string that best matches the given units string. -
isSetToUndefined
public boolean isSetToUndefined()Deprecated. -
toString
Deprecated. -
getAvailableUnits
Deprecated. -
equals
Deprecated. -
isValidUnitsSystem
public static boolean isValidUnitsSystem(int system) Deprecated. -
getUnitSystemForUnits
Deprecated.Static method whichs takes a unit label and attempts to find the matching unit system -
convertUnits
public static double convertUnits(double x, String fromUnits, String toUnits) throws UnitsConversionException Deprecated.- Throws:
UnitsConversionException
-
getUnitsStringForUnitsId
Deprecated.return the Units String (ENGLISH, SI, UNDEFINED_UNITS
) for the Units Id (ENGLISH_ID, SI_ID, UNDEF_ID
)- Parameters:
unitsId
- one of ENGLISH_ID, SI_ID, UNDEF_ID- Returns:
- ENGLISH, SI, UNDEFINED_UNITS
-
getUnitsInUnitSystem
public static String getUnitsInUnitSystem(String unitsSystem, String unitsFrom) throws UnitsConversionException Deprecated.- Throws:
UnitsConversionException
-
canConvertBetweenUnits
Deprecated. -
getAllUnitsThatCanConvertTo
Deprecated.Returns an ArrayList of all units that can convert to the given unit.- Parameters:
unit
-- Returns:
-
getAliasesForUnits
Deprecated. -
isUnitsInAlias
Deprecated.This method returns true if the if the given units is contained in the list of aliases for the given aliasUnits or exactly matches the given aliasUnits. Units are case sensitive.- Parameters:
units
-aliasUnits
-- Returns:
-
getBestMatch
Deprecated. -
convertUnits
public static ParamDouble convertUnits(ParamDouble x, String fromUnits, String toUnits) throws UnitsConversionException Deprecated.- Throws:
UnitsConversionException
-
convertUnits
public static ParamDoubleArray convertUnits(ParamDoubleArray x, String fromUnits, String toUnits) throws UnitsConversionException Deprecated.- Throws:
UnitsConversionException
-
getScalarFactor
public static double getScalarFactor(String fromUnits, String toUnits) throws UnitsConversionException Deprecated.Does a lookup to find a scalar factor that converts between the two units.- Parameters:
fromUnits
- the units string to convert fromtoUnits
- the units string to convert to.- Throws:
UnitsConversionException
-
convertUnits
public static double convertUnits(double x, int paramID, int fromUnitSystem, int toUnitSystem) throws UnitsConversionException Deprecated.Converts a value from one unit system to another.- Parameters:
x
- value to be convertedparamID
- parameter type as defined in hec.data.ParameterfromUnitSystem
- unit system to convert from, SI_ID or ENGLISH_IDtoUnitSystem
- unit system to convert to, SI_ID or ENGLISH_ID- Returns:
- the converted value.
- Throws:
UnitsConversionException
- See Also:
-
convertUnits
public static void convertUnits(double[] x, int paramID, int fromUnitSystem, int toUnitSystem) throws UnitsConversionException Deprecated.Converts an array from one unit system to another.- Parameters:
x
- value to be convertedparamID
- parameter type as defined in hec.data.ParameterfromUnitSystem
- unit system to convert from, SI_ID or ENGLISH_IDtoUnitSystem
- unit system to convert to, SI_ID or ENGLISH_ID- Throws:
UnitsConversionException
- See Also:
-
convertUnits
public static void convertUnits(double[] x, String fromUnits, String toUnits) throws UnitsConversionException Deprecated.- Throws:
UnitsConversionException
-
getStorageToFlowConversion
public static double getStorageToFlowConversion(String storageUnits, String flowUnits) throws UnitsConversionException Deprecated.Interpret unit strings for storage and flow to develop scale factor to convert storage units (ac-ft, m3) to flow units (cfs, cms). Note!!! User must divide the returned value by the time step in seconds- Parameters:
storageUnits
- Units string for storage ( ac-ft, m3 )flowUnits
- Units string for flow ( cfs, cms )- Returns:
- The conversion factor to scale storage to flow. Note!!! This factor must be divided by the time step in seconds!
- Throws:
UnitsConversionException
-
convertUnits
Deprecated. -
convertUnits
Deprecated. -
convertUnits
Deprecated. -
convertUnits
Deprecated. -
convertUnits
public static int convertUnits(double[] data, int number, int fromUnitSyst, int toUnitSyst, stringContainer units) Deprecated. -
getUnitsMetaData
public mil.army.usace.hec.metadata.Units getUnitsMetaData()Deprecated.
-
Units
andUnitUtil
from hec-nucleus-metadata instead.