Package overit.geocall.util.measure
Class MeasureConverter
java.lang.Object
overit.geocall.util.measure.MeasureConverter
- All Implemented Interfaces:
Serializable
This class aims to make conversions between units measurement.
To convert a value it's mandatory to defines an origin unit and a destination unit, between which you want to make the conversion.
See for example
To convert a value it's mandatory to defines an origin unit and a destination unit, between which you want to make the conversion.
See for example
get(overit.geocall.util.measure.distances.Distances, overit.geocall.util.measure.distances.Distances) and convert(java.lang.Double)- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionMakes the conversion from the origin unit measurement value to the destination unit measurement.static MeasureConverterGets theMeasureConverterobject with which make the conversion between originUnit and destUnit of the distances category.
For example, to convert from kilometers to miles, this method would have to be used like:MeasureConverter.get(Distances.KILOMETERS,Distances.MILES);static MeasureConverterget(Temperatures originUnit, Temperatures destUnit) Gets theMeasureConverterobject with which make the conversion between originUnit and destUnit of the temperatures category.
For example, to convert from celsius to kelvin, this method would have to be used like:MeasureConverter.get(Temperatures.CELSIUS,temperatures.KELVIN);static MeasureConverterGets theMeasureConverterobject with which make the conversion between originUnit and destUnit of the weights category.
For example, to convert from kilograms to pounds, this method would have to be used like:MeasureConverter.get(Weights.KILOGRAMS,Weights.POUNDS);
-
Method Details
-
get
Gets theMeasureConverterobject with which make the conversion between originUnit and destUnit of the distances category.
For example, to convert from kilometers to miles, this method would have to be used like:MeasureConverter.get(Distances.KILOMETERS,Distances.MILES);- Parameters:
originUnit- The origin unit measurement.destUnit- The destination unit measurement desired.- Returns:
- The
MeasureConverterobject with which make the conversion between originUnit and destUnit of the distances category.
-
get
Gets theMeasureConverterobject with which make the conversion between originUnit and destUnit of the weights category.
For example, to convert from kilograms to pounds, this method would have to be used like:MeasureConverter.get(Weights.KILOGRAMS,Weights.POUNDS);- Parameters:
originUnit- The origin unit measurement.destUnit- The destination unit measurement desired.- Returns:
- The
MeasureConverterobject with which make the conversion between originUnit and destUnit of the weights category.
-
get
Gets theMeasureConverterobject with which make the conversion between originUnit and destUnit of the temperatures category.
For example, to convert from celsius to kelvin, this method would have to be used like:MeasureConverter.get(Temperatures.CELSIUS,temperatures.KELVIN);- Parameters:
originUnit- The origin unit measurement.destUnit- The destination unit measurement desired.- Returns:
- The
MeasureConverterobject with which make the conversion between originUnit and destUnit of the temperatures category.
-
convert
Makes the conversion from the origin unit measurement value to the destination unit measurement.- Parameters:
value- The value to convert.- Returns:
- The converted value.
-