public class Speed
extends java.lang.Object
Constructor and Description |
---|
Speed(int speed,
DistanceUnit unit)
Create a Speed object for the specified magnitude and unit.
|
Speed(java.lang.String value)
Create a Speed object from the specified string
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getIsoCountryCode()
Get the ISO country code (if any) associated with this Speed value.
|
int |
getSpeed()
Get the speed in the specified unit.
|
DistanceUnit |
getUnit()
Get the DistanceUnit (interpreted as a speed unit in DistanceUnit per hour) for this Speed.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
public Speed(java.lang.String value)
value
- String to be interpreted as a speed value, possibly with appended units and prefixed country codepublic Speed(int speed, DistanceUnit unit)
speed
- int speed magnitudeunit
- DistanceUnit corresponding to the units-per-hour speed valuepublic int getSpeed()
getUnit()
public DistanceUnit getUnit()
public java.lang.String getIsoCountryCode()
public java.lang.String toString()
toString
in class java.lang.Object