public class StreamLocationProviderOffsetComparator extends Object implements Comparator<StreamLocationProvider>
StreamLocationProvider
, which uses
StreamLocationProvider.getCharacterOffset()
as the only comparison criterion.
Note that the line and column number properties are not taken into account. As a consequence
this comparator is not necessarily consistent with the equals(Object)
methods of the implementations of
StreamLocationProvider
. (If this comparator returns 0 for two objects, these objects are not
necessarily equal, they only have the same character offset.) Therefore this comparator should
not be used together with sorted sets or sorted maps, as described in the documentation of Comparator
.
Constructor and Description |
---|
StreamLocationProviderOffsetComparator() |
Modifier and Type | Method and Description |
---|---|
int |
compare(StreamLocationProvider o1,
StreamLocationProvider o2) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public StreamLocationProviderOffsetComparator()
public int compare(StreamLocationProvider o1, StreamLocationProvider o2)
compare
in interface Comparator<StreamLocationProvider>