Velocity
public final class Velocity implements Comparable
Represents a unit of speed. Supported units:
-
metersPerSecond - see
Velocity.metersPerSecond,Double.metersPerSecond -
kilometersPerHour - see
Velocity.kilometersPerHour,Double.kilometersPerHour -
milesPerHour - see
Velocity.milesPerHour,Double.milesPerHour
Summary
Public methods |
|
|---|---|
int |
|
boolean |
|
final double |
Returns the velocity in kilometers per hour. |
final double |
Returns the velocity in meters per second. |
final double |
Returns the velocity in miles per hour. |
int |
hashCode() |
static final @NonNull Velocity |
kilometersPerHour(double value)Creates |
static final @NonNull Velocity |
metersPerSecond(double value)Creates |
static final @NonNull Velocity |
milesPerHour(double value)Creates |
@NonNull String |
toString() |
Public methods
getKilometersPerHour
public final double getKilometersPerHour()
Returns the velocity in kilometers per hour.
getMetersPerSecond
public final double getMetersPerSecond()
Returns the velocity in meters per second.
getMilesPerHour
public final double getMilesPerHour()
Returns the velocity in miles per hour.
kilometersPerHour
public static final @NonNull Velocity kilometersPerHour(double value)
Creates Velocity with the specified value in kilometers per hour.
metersPerSecond
public static final @NonNull Velocity metersPerSecond(double value)
Creates Velocity with the specified value in meters per second.
milesPerHour
public static final @NonNull Velocity milesPerHour(double value)
Creates Velocity with the specified value in miles per hour.