MeasurementValueConfiguration

class MeasurementValueConfiguration(val name: String?, val scale: Scale, val precision: MeasurementPrecision) : ScaleAndPrecision

Configures a measurement value and consists of a Scale, MeasurementPrecision, and a name for this configuration. These properties describe how the actual measurement value is calculated and formatted for the measurement annotations. The name property is just to have the option to display a user-friendly name in the UI, it has no further use. If we ever check for duplicates, or try to find a specific MeasurementValueConfiguration in the document's configuration list, only scale and precision matter. That being said, the combination of scale and precision needs to be unique - you cannot have two MeasurementValueConfigurations in the document with same scale and precision. The name can be null, in that case the UI shows generated name.

See also

Constructors

Link copied to clipboard
constructor(name: String?, scale: Scale, precision: MeasurementPrecision)

Types

Link copied to clipboard
object Companion

Companion object containing factory methods and default configuration management.

Properties

Link copied to clipboard
val name: String?

The user-friendly name for this configuration, or null to use a generated name.

Link copied to clipboard
open override val precision: MeasurementPrecision

The precision used for formatting measurement values.

Link copied to clipboard
open override val scale: Scale

The scale defining the ratio between document and real-world measurements.

Functions

Link copied to clipboard
fun equalsAll(other: Any?): Boolean

Compares name as well as scale and precision. The standard equals only checks what makes a unique MeasurementValueConfiguration, which is Scale and MeasurementPrecision.

Link copied to clipboard
fun getDefaultName(includePrecision: Boolean): String

Get the default generated name based on the scale.

Link copied to clipboard
fun getNameForDisplay(includePrecision: Boolean): String

Get the display name for this configuration.

Link copied to clipboard
open override fun hashCode(): Int

Returns a hash code value for this configuration based on its scale and precision.