public interface IRangeComparator
It is used by
RangeDifferencer to find longest sequences of
matching and non-matching ranges.
For example, to compare two text documents and find longest common sequences
of matching and non-matching lines, the implementation must break the document
getRangeCount would return the number of lines in the
rangesEqual would compare a specified line given
with one in another
Clients should implement this interface; there is no standard implementation.
|Modifier and Type||Method and Description|
Returns the number of comparable entities.
Returns whether the comparable entity given by the first index matches an entity specified by the other
Returns whether a comparison should be skipped because it would be too costly (or lengthy).
boolean rangesEqual(int thisIndex, IRangeComparator other, int otherIndex)
thisIndex- the index of the comparable entity within this
other- the IRangeComparator to compare this with
otherIndex- the index of the comparable entity within the other
trueif the comparable entities are equal
boolean skipRangeComparison(int length, int maxLength, IRangeComparator other)
length- a number on which to base the decision whether to return
maxLength- another number on which to base the decision whether to return
other- the other
IRangeComparatorto compare with
trueto avoid a too lengthy range comparison
Copyright (c) 2000, 2013 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.