Package org.apache.sis.util.collection
Class RangeSet.Compare<E extends Comparable<? super E>>
java.lang.Object
org.apache.sis.util.collection.RangeSet.Compare<E>
- Type Parameters:
E
- the type of range elements.
- All Implemented Interfaces:
Serializable
,Comparator<Range<E>>
- Enclosing class:
- RangeSet<E extends Comparable<? super E>>
private static final class RangeSet.Compare<E extends Comparable<? super E>>
extends Object
implements Comparator<Range<E>>, Serializable
The range comparator returned by
RangeSet.comparator()
. This comparator
is defined for compliance with the SortedSet
contract, but is not not
used by the RangeSet
implementation.
This comparator can order non-ambiguous ranges: the minimum and maximum values
of one range shall both be smaller, equal or greater than the values of the other
range. In case of ambiguity (when a range in included in the other range), this
comparator throws an exception. Such ambiguities should not happen in sequences
of ranges created by RangeSet
.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final RangeSet.Compare
The singleton instance, as a raw type in order to allowRangeSet.comparator()
to return the same instance for all types.private static final long
For cross-version compatibility. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
INSTANCE
The singleton instance, as a raw type in order to allowRangeSet.comparator()
to return the same instance for all types.
-
-
Constructor Details
-
Compare
private Compare()Constructor for the singleton instance only.
-
-
Method Details
-
compare
Compares the given range instance. See class-javadoc for more information.- Specified by:
compare
in interfaceComparator<E extends Comparable<? super E>>
-
readResolve
Returns the singleton instance on deserialization.- Throws:
ObjectStreamException
-