public final class Velocity implements Comparable


Represents a unit of speed. Supported units:

Summary

Public methods

int
boolean
equals(Object other)
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
static final @NonNull Velocity
kilometersPerHour(double value)

Creates Velocity with the specified value in kilometers per hour.

static final @NonNull Velocity
metersPerSecond(double value)

Creates Velocity with the specified value in meters per second.

static final @NonNull Velocity
milesPerHour(double value)

Creates Velocity with the specified value in miles per hour.

@NonNull String

Public methods

compareTo

Added in 1.1.0-alpha10
public int compareTo(@NonNull Velocity other)

equals

public boolean equals(Object other)

getKilometersPerHour

Added in 1.1.0-alpha10
public final double getKilometersPerHour()

Returns the velocity in kilometers per hour.

getMetersPerSecond

Added in 1.1.0-alpha10
public final double getMetersPerSecond()

Returns the velocity in meters per second.

getMilesPerHour

Added in 1.1.0-alpha10
public final double getMilesPerHour()

Returns the velocity in miles per hour.

hashCode

public int hashCode()

kilometersPerHour

Added in 1.1.0-alpha10
public static final @NonNull Velocity kilometersPerHour(double value)

Creates Velocity with the specified value in kilometers per hour.

metersPerSecond

Added in 1.1.0-alpha10
public static final @NonNull Velocity metersPerSecond(double value)

Creates Velocity with the specified value in meters per second.

milesPerHour

Added in 1.1.0-alpha10
public static final @NonNull Velocity milesPerHour(double value)

Creates Velocity with the specified value in miles per hour.

toString

public @NonNull String toString()