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 StringDeprecated.static final intDeprecated.static final StringDeprecated.static final StringDeprecated.static final intDeprecated.static final intDeprecated.static final StringDeprecated.Fields inherited from class hec.data.AbstractDataSet
subFieldDelimiter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanConvertBetweenUnits(String fromUnits, String toUnits) Deprecated.static voidconvertUnits(double[] x, int paramID, int fromUnitSystem, int toUnitSystem) Deprecated.Converts an array from one unit system to another.static intconvertUnits(double[] data, int number, int fromUnitSyst, int toUnitSyst, stringContainer units) Deprecated.static voidconvertUnits(double[] x, String fromUnits, String toUnits) Deprecated.static doubleconvertUnits(double x, int paramID, int fromUnitSystem, int toUnitSystem) Deprecated.Converts a value from one unit system to another.static doubleconvertUnits(double x, String fromUnits, String toUnits) Deprecated.static ParamDoubleArrayconvertUnits(ParamDoubleArray x, String fromUnits, String toUnits) Deprecated.static ParamDoubleconvertUnits(ParamDouble x, String fromUnits, String toUnits) Deprecated.static intconvertUnits(DataContainer container, int toUnitSyst) Deprecated.static intconvertUnits(PairedDataContainer container, int toUnitSyst) Deprecated.static intconvertUnits(TimeSeriesContainer container, int toUnitSyst) Deprecated.static voidconvertUnits(List<Object> containers, int toUnitSyst) Deprecated.booleanDeprecated.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 StringgetBestMatch(String units) Deprecated.static doublegetScalarFactor(String fromUnits, String toUnits) Deprecated.Does a lookup to find a scalar factor that converts between the two units.static doublegetStorageToFlowConversion(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 StringgetUnitsForAlias(String alias) Deprecated.static StringgetUnitsInUnitSystem(String unitsSystem, String unitsFrom) Deprecated.mil.army.usace.hec.metadata.UnitsDeprecated.static StringgetUnitsStringForUnitsId(int unitsId) Deprecated.return the Units String (ENGLISH, SI, UNDEFINED_UNITS) for the Units Id (ENGLISH_ID, SI_ID, UNDEF_ID)static intgetUnitSystemForUnits(String unitStr) Deprecated.Static method whichs takes a unit label and attempts to find the matching unit systembooleanDeprecated.static booleanisUnitsInAlias(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 booleanisValidUnitsSystem(int system) Deprecated.voidDeprecated.voidDeprecated.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.
-
UnitsandUnitUtilfrom hec-nucleus-metadata instead.