- java.lang.Object
-
- java.lang.Enum<SpeedUnit>
-
- org.arakhne.afc.math.physics.SpeedUnit
-
- All Implemented Interfaces:
Serializable
,Comparable<SpeedUnit>
public enum SpeedUnit extends Enum<SpeedUnit>
A SpeedUnit represents speed at a given unit of granularity.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:49
- Author:
- Stéphane GALLAND
- See Also:
MeasureUnitUtil
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathphysics
-
-
Enum Constant Summary
Enum Constants Enum Constant Description KILOMETERS_PER_HOUR
kilometer/hour.METERS_PER_SECOND
meters/second.MILLIMETERS_PER_SECOND
millimeters/second.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getSymbol()
Replies the localized symbol for this space unit.SpeedUnit
lower()
Replies the speed unit just lower than the current speed unit, or the speed unit itself if it is the smallest.SpaceUnit
toSpaceUnit()
Replies the space unit that corresponds to this speed unit.TimeUnit
toTimeUnit()
Replies the time unit that corresponds to this speed unit.SpeedUnit
upper()
Replies the speed unit just upper than the current speed unit, or the speed unit itself if it is the uppest.static SpeedUnit
valueOf(String name)
Returns the enum constant of this type with the specified name.static SpeedUnit[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Method Detail
-
values
public static SpeedUnit[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SpeedUnit c : SpeedUnit.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SpeedUnit valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
toTimeUnit
@Pure public TimeUnit toTimeUnit()
Replies the time unit that corresponds to this speed unit.- Returns:
- the time unit.
-
toSpaceUnit
@Pure public SpaceUnit toSpaceUnit()
Replies the space unit that corresponds to this speed unit.- Returns:
- the space unit.
-
lower
@Pure public SpeedUnit lower()
Replies the speed unit just lower than the current speed unit, or the speed unit itself if it is the smallest.- Returns:
- the speed unit just lower than the current speed unit, or the speed unit itself if it is the smallest.
-
upper
@Pure public SpeedUnit upper()
Replies the speed unit just upper than the current speed unit, or the speed unit itself if it is the uppest.- Returns:
- the speed unit just upper than the current speed unit, or the speed unit itself if it is the uppest.
-
getSymbol
@Pure public String getSymbol()
Replies the localized symbol for this space unit.- Returns:
- the localized symbol for this space unit.
-
-