Spondee: measures

A class set for wrapping units of measure in an application.

License

License

MIT
Categories

Categories

Data
GroupId

GroupId

com.inkapplications.spondee
ArtifactId

ArtifactId

measures-metadata
Last Version

Last Version

0.0.0
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

Spondee: measures
A class set for wrapping units of measure in an application.
Project URL

Project URL

https://github.com/inkapplications/spondee
Source Code Management

Source Code Management

https://github.com/InkApplications/spondee

Download measures-metadata

Dependencies

compile (1)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib-common jar 1.4.30

Project Modules

There are no modules declared in this project.

Spondee

A class set for wrapping units of measure in an application.

FAQ

What is this?

A collection of classes representing units of measure that can be used in an application.

Why not use a plain number type?

Plain numbers are often ambiguous. Consider the method:

fun setLight(brightness: Number)

What number would you pass in to set the light to half brightness?

Is this a comprehensive set of units?

Absolutely not. Feel free to add them.

What is the worst unit?

Bels.

Are these optimized for efficiency?

No. Math on these units are often done with Double precision. If this is a problem in your application, they can be converted to a plain number for efficiency. In reality, though, it's probably fine.

Design Rules

Here are some rules that are followed on this project. If you contribute, please follow them.

  • Units should be data classes
    • (These will eventually all be migrated to value class when stable)
  • All ambiguous math is done with the Double type
  • Direct wrapping is done with value extensions. (eg. 55.percent)
com.inkapplications.spondee

Ink Applications

Open source developer tools and web services.

Versions

Version
0.0.0