DistanceUnit

org.abh80.nf.core.metrics.DistanceUnit
See theDistanceUnit companion trait
object DistanceUnit

Companion object for DistanceUnit containing implementations of different distance units and utility methods for distance calculations

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

case class AstronomicalUnit(value: Double) extends DistanceUnit

Represents distance in astronomical units (AU)

Represents distance in astronomical units (AU)

Value parameters

value

the distance value in astronomical units

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait DistanceUnit
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Show all
Self type
implicit class BinOp(self: DistanceUnit)

Provides binary operations for DistanceUnit

Provides binary operations for DistanceUnit

Value parameters

self

the DistanceUnit instance on which operations are performed

Attributes

Supertypes
class Object
trait Matchable
class Any
case class Kilometer(value: Double) extends DistanceUnit

Represents distance in kilometers

Represents distance in kilometers

Value parameters

value

the distance value in kilometers

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait DistanceUnit
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Show all
Self type
Kilometer.type
case class Meter(value: Double) extends DistanceUnit

Represents distance in meters

Represents distance in meters

Value parameters

value

the distance value in meters

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait DistanceUnit
class Object
trait Matchable
class Any
Show all

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def fromMeters[T <: DistanceUnit](meters: Double, unitFactory: Double => T): T

Creates a specific distance unit from meters

Creates a specific distance unit from meters

Type parameters

T

the type of distance unit to create

Value parameters

meters

the distance in meters

unitFactory

the factory function to create the desired unit

Attributes

Returns

distance in the specified unit

Implicits

Implicits

final implicit def BinOp(self: DistanceUnit): BinOp

Provides binary operations for DistanceUnit

Provides binary operations for DistanceUnit

Value parameters

self

the DistanceUnit instance on which operations are performed

Attributes