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 Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • INSTANCE

      static final RangeSet.Compare INSTANCE
      The singleton instance, as a raw type in order to allow RangeSet.comparator() to return the same instance for all types.
  • Constructor Details

    • Compare

      private Compare()
      Constructor for the singleton instance only.
  • Method Details