JSR 363 RI User Guide
  • Introduction
  • Overview
  • Supported Units
  • Abstract Base Classes
    • Abstract Quantity
    • AbstractUnit
  • Factory Accessors
    • Units
    • Quantities
  • Library
  • Formatting
  • Functional Elements
    • Conversion
  • RI Level SPI
    • Measurement Interface
    • Range Class
  • Non Functional Requirements
    • Preserving precision
  • Examples
    • Hurricane Wind Scale
    • Using Enums
Powered by GitBook
On this page
  1. RI Level SPI

Range Class

PreviousMeasurement InterfaceNextNon Functional Requirements

Last updated 7 years ago

Range is a compromise between much broader and complex approaches like Google Guava and a too narrow and limited ValueRange type [] added to Java 8 (something like TemporalRange could have been a better name there, because it uses another specific type TemporalField and is therefore useless outside the Temporal context) The generic base type Range is suitable for cases where one does not know the exact parameterized quantity type, e.g. results of operations like divide() or multiply() when asType() cannot be applied. The specialized subclass QuantityRange is somewhat modeled after definitions in [OGC_OM] and has slight similarities with the MeasurementRange class from [JSR-256] but using Generics which were not available at the time.

JSR-310