Overview

NOTUVY Measurement (notuvyunit) is a framework for representing measurements. A measurement is defined as a numberic value with an associated unit. This provides a way for values to be stored, manipulated, and displayed in a variety of ways. Measurements can be freely converted to the equivalent value in different units.

The preferred value definition is a double to allow maximum precision when converting between large and small units. For convenience, a whole number representation is also provided.

Benefits of Using This Framework

This is a fairly simple framework. The core functionality could easily be implemented by developers on their own for simple use cases. However, the built-in features bring some power that could motivate developers to use this library instead of doing it themselves.

These features are a simple approach to conversion, automatic comparability, and easy facility for display for human readability.

Easy Conversion

A value in one unit can be easily converted to to another value in the same unit "category". (Invalid conversion attempts generate a runtime exception.)

Comparability

Values in different units can be checked for equality. Values in different units can be sorted in a collection.

Human Readability

A value may be in unit that has a large value (like 31784612 bytes) or a very small value (like 0.00004218 miles), it is not an intuitively recognizable quantity. The framework can be directed to convert it to a more "optimal" unit. (The former is more clearly displayed as 30 megabytes, and the latter as 2.67 inches.)