A set of minimum and maximum values of a certain class, allowing a user to determine if a value of the same class is contained inside the range. The minimum and maximum values do not have to be included in the range, and can be null. If the minimum or maximum values are null, the range is said to be unbounded on that endpoint. If both the minimum and maximum are null, the range is completely unbounded and all values of that class are contained within the range. Null values are always considered
exclusive, since iterations over the values will never reach the infinite endpoint.
The minimal and maximal values (the endpoints) may be inclusive or exclusive. Numeric ranges where both endpoints are inclusive are called closed intervals and are represented by square brackets, for example " {@code [0 … 255]}". Numeric ranges where both endpoints are exclusive are called open intervals and are represented by parenthesis, for example " {@code (0 … 256)}".
{@section Type and value of range elements}To be a member of a {@code Range}, the {@code
} type defining the range must implement the{@link Comparable} interface. All argument values given to the methods of this class shall beor contain instances of that {@code } type. The type is enforced by parameterized type,but some subclasses may put additional constraints. For example {@link MeasurementRange} willadditionally checks the units of measurement. Consequently every methods defined in this class may throw an {@link IllegalArgumentException} if a given argument does not meet some constraintbeyond the type. {@section Relationship with ISO 19123 definition of range}The ISO 19123 standard (Coverage geometry and functions) defines the range as the set (either finite or {@linkplain org.opengis.geometry.TransfiniteSet transfinite}) of feature attribute values associated by a function (the {@linkplain org.opengis.coverage.Coverage coverage}) with the elements of the coverage domain. In other words, if we see a coverage as a function, then a range is the set of possible return values. The characteristics of the spatial domain are defined by the ISO 19123 standard whereas the characteristics of the attribute range are not part of that standard. In Apache SIS, those characteristics are described by the {@link org.apache.sis.coverage.SampleDimension} class,which may contain one or many {@code Range} instances. Consequently this {@code Range} classis closely related, but not identical, to the ISO 19123 definition or range.
Ranges are not necessarily numeric. Numeric and non-numeric ranges can be associated to {@linkplain org.opengis.coverage.DiscreteCoverage discrete coverages}, while typically only numeric ranges can be associated to {@linkplain org.opengis.coverage.ContinuousCoverage continuous coverages}.
@param < E> The type of range elements, typically a {@link Number} subclass or {@link java.util.Date}.
@author Joe White
@author Martin Desruisseaux (Geomatys)
@author Jody Garnett (for parameterized type inspiration)
@since 0.3
@version 0.3
@module
@see RangeFormat
@see org.apache.sis.util.collection.RangeSet