Speed

public final class Speed
extends Object

java.lang.Object
   ↳ androidx.car.app.hardware.info.Speed


Information about the current car speed.

Summary

Nested classes

class Speed.Builder

A builder of Speed

Public methods

boolean equals(Object other)
CarValue<Float> getDisplaySpeedMetersPerSecond()

Returns the display speed of the car in meters/second.

CarValue<Float> getRawSpeedMetersPerSecond()

Returns the raw speed of the car in meters/second.

CarValue<Integer> getSpeedDisplayUnit()

Returns the units used to display speed from the car settings.

int hashCode()
String toString()

Inherited methods

Public methods

equals

public boolean equals (Object other)

Parameters
other Object

Returns
boolean

getDisplaySpeedMetersPerSecond

public CarValue<Float> getDisplaySpeedMetersPerSecond ()

Returns the display speed of the car in meters/second.

Some cars display a slightly slower speed than the actual speed. This is usually displayed on the speedometer.

The value is positive when the vehicle is moving forward, negative when moving backwards and zero when stopped.

Returns
CarValue<Float>

getRawSpeedMetersPerSecond

public CarValue<Float> getRawSpeedMetersPerSecond ()

Returns the raw speed of the car in meters/second.

The value is positive when the vehicle is moving forward, negative when moving backwards and zero when stopped.

Returns
CarValue<Float>

getSpeedDisplayUnit

public CarValue<Integer> getSpeedDisplayUnit ()

Returns the units used to display speed from the car settings.

See CarUnit for valid speed units.

Returns
CarValue<Integer>

hashCode

public int hashCode ()

Returns
int

toString

public String toString ()

Returns
String