Package com.irurueta.units
Enum Class VolumeUnit
- All Implemented Interfaces:
Serializable,Comparable<VolumeUnit>,Constable
Enumerator containing recognized typical volume units.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionBarrel.Cubic centimeter.Cubic decimeter.Cubic foot.Cubic inch.Cubic meter.Gallon.Hectoliter.Liter.Milliliter.Pint. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic VolumeUnit[]Gets all supported imperial volume units.static VolumeUnit[]Gets all supported metric volume units.static UnitSystemgetUnitSystem(VolumeUnit unit) Returns unit system from provided volume unit.static booleanisImperial(VolumeUnit unit) Indicates whether provided unit belongs to the imperial unit system.static booleanisMetric(VolumeUnit unit) Indicates whether provided unit belongs to the metric unit system.static VolumeUnitReturns the enum constant of this class with the specified name.static VolumeUnit[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CUBIC_CENTIMETER
Cubic centimeter. -
MILLILITER
Milliliter. -
CUBIC_DECIMETER
Cubic decimeter. -
LITER
Liter. -
HECTOLITER
Hectoliter. -
CUBIC_METER
Cubic meter. -
CUBIC_INCH
Cubic inch. -
PINT
Pint. -
GALLON
Gallon. -
CUBIC_FOOT
Cubic foot. -
BARREL
Barrel.
-
-
Constructor Details
-
VolumeUnit
private VolumeUnit()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getUnitSystem
Returns unit system from provided volume unit.- Parameters:
unit- volume unit to be checked.- Returns:
- unit system (metric or imperial).
- Throws:
IllegalArgumentException- if unit is null or not supported.
-
getMetricUnits
Gets all supported metric volume units.- Returns:
- all supported metric volume units.
-
getImperialUnits
Gets all supported imperial volume units.- Returns:
- all supported imperial volume units.
-
isMetric
Indicates whether provided unit belongs to the metric unit system.- Parameters:
unit- volume unit to be checked.- Returns:
- true if unit belongs to metric unit system.
- Throws:
IllegalArgumentException- if unit is null or not supported.
-
isImperial
Indicates whether provided unit belongs to the imperial unit system.- Parameters:
unit- volume unit to be checked.- Returns:
- true if unit belongs to imperial unit system.
- Throws:
IllegalArgumentException- if unit is null or not supported.
-