class Length : Comparable


Represents a unit of length. Supported units: meters, kilometers, miles, inches and feet.

Summary

Public companion functions

Length
feet(value: Double)

Creates Length with the specified value in feet.

Length
inches(value: Double)

Creates Length with the specified value in inches.

Length

Creates Length with the specified value in kilometers.

Length
meters(value: Double)

Creates Length with the specified value in meters.

Length
miles(value: Double)

Creates Length with the specified value in miles.

Public functions

open operator Int
compareTo(other: Length)
open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

Double

Returns the length in feet.

Double

Returns the length in inches.

Double

Returns the length in kilometers.

Double

Returns the length in meters.

Double

Returns the length in miles.

Public companion functions

feet

Added in 1.1.0-alpha07
fun feet(value: Double): Length

Creates Length with the specified value in feet.

inches

Added in 1.1.0-alpha07
fun inches(value: Double): Length

Creates Length with the specified value in inches.

kilometers

Added in 1.1.0-alpha07
fun kilometers(value: Double): Length

Creates Length with the specified value in kilometers.

meters

Added in 1.1.0-alpha07
fun meters(value: Double): Length

Creates Length with the specified value in meters.

miles

Added in 1.1.0-alpha07
fun miles(value: Double): Length

Creates Length with the specified value in miles.

Public functions

compareTo

Added in 1.1.0-alpha07
open operator fun compareTo(other: Length): Int

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

inFeet

Added in 1.1.0-alpha07
val inFeetDouble

Returns the length in feet.

inInches

Added in 1.1.0-alpha07
val inInchesDouble

Returns the length in inches.

inKilometers

Added in 1.1.0-alpha07
val inKilometersDouble

Returns the length in kilometers.

inMeters

Added in 1.1.0-alpha07
val inMetersDouble

Returns the length in meters.

inMiles

Added in 1.1.0-alpha07
val inMilesDouble

Returns the length in miles.