Package org.apache.sis.metadata
Class DomainRange<E extends Number & Comparable<? super E>>
java.lang.Object
org.apache.sis.measure.Range<E>
org.apache.sis.measure.NumberRange<E>
org.apache.sis.metadata.DomainRange<E>
- Type Parameters:
E- the type of range elements as a subclass ofNumber.
- All Implemented Interfaces:
Serializable,CharSequence,Comparable<org.opengis.util.InternationalString>,Formattable,CheckedContainer<E>,Emptiable,org.opengis.util.InternationalString
final class DomainRange<E extends Number & Comparable<? super E>>
extends NumberRange<E>
implements org.opengis.util.InternationalString
The range of values that a metadata property can take, representable as an
InternationalString
in order to make possible to return this range from the PropertyInformation.getDomainValue()
method.- Since:
- 0.3
- Version:
- 0.3
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longFor cross-version compatibility.private StringThe locale-independent string representation, built bytoString()when first needed. -
Constructor Summary
ConstructorsConstructorDescriptionDomainRange(Class<E> type, ValueRange range) Constructs a range of the given type with values from the given annotation. -
Method Summary
Modifier and TypeMethodDescriptioncharcharAt(int index) Returns the character at the given index in the unlocalized string.private intcompareTo(DomainRange<?> range) Compares this range with the given range object for ordering of minimal values, or maximal values if two ranges have the same minimum value.intcompareTo(org.opengis.util.InternationalString o) Compares the unlocalized string representations.intlength()Returns the length of the unlocalized string.subSequence(int start, int end) Returns a subsequence of the unlocalized string representation.toString()Builds, caches and returns the unlocalized string representation of this range.Returns the string representation in the given locale.Methods inherited from class org.apache.sis.measure.NumberRange
castOrCopy, castTo, containsAny, containsAny, create, create, create, create, create, create, create, createBestFit, createBestFit, createLeftBounded, getMaxDouble, getMaxDouble, getMedian, getMinDouble, getMinDouble, getSpan, intersectAny, intersectsAny, subtractAny, transform, unionAnyMethods inherited from class org.apache.sis.measure.Range
contains, contains, equals, formatTo, getElementType, getMaxValue, getMinValue, hashCode, intersect, intersects, isBounded, isEmpty, isMaxIncluded, isMinIncluded, subtract, unionMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.CharSequence
chars, codePoints
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
text
The locale-independent string representation, built bytoString()when first needed.
-
-
Constructor Details
-
DomainRange
DomainRange(Class<E> type, ValueRange range) throws IllegalArgumentException Constructs a range of the given type with values from the given annotation. This constructor does not verify if the given type is wide enough for the values of the given annotation, because those information are usually static. If nevertheless the given type is not wide enough, then the values are truncated in the same way than the Java language casts primitive types.
-
-
Method Details
-
toString
Returns the string representation in the given locale.- Specified by:
toStringin interfaceorg.opengis.util.InternationalString
-
toString
Builds, caches and returns the unlocalized string representation of this range.- Specified by:
toStringin interfaceCharSequence- Specified by:
toStringin interfaceorg.opengis.util.InternationalString- Overrides:
toStringin classRange<E extends Number & Comparable<? super E>>- See Also:
-
length
public int length()Returns the length of the unlocalized string.- Specified by:
lengthin interfaceCharSequence
-
charAt
public char charAt(int index) Returns the character at the given index in the unlocalized string.- Specified by:
charAtin interfaceCharSequence
-
subSequence
Returns a subsequence of the unlocalized string representation.- Specified by:
subSequencein interfaceCharSequence
-
compareTo
public int compareTo(org.opengis.util.InternationalString o) Compares the unlocalized string representations. In the special case where the other instance is aDomainRange, actually compares the numerical values for better ordering.- Specified by:
compareToin interfaceComparable<E extends Number & Comparable<? super E>>
-
compareTo
Compares this range with the given range object for ordering of minimal values, or maximal values if two ranges have the same minimum value.Notes:
- This method requires
DomainRangeinstance rather than more genericNumberRangein order to ensure reciprocity:A.compareTo(B) == -B.compareTo(A). - This ordering is appropriate for
DomainRangebecause it is close to the ordering of their string representations, but is otherwise not provided for generalRangeobjects because the ordering criterion would be arbitrary for them (what would be the best ordering of overlapping ranges?).
- This method requires
-