|
Eclipse Platform Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IRangeComparator
For breaking an object to compare into a sequence of comparable entities.
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
into lines. getRangeCount would return the number of lines in the
document, and rangesEqual would compare a specified line given
with one in another IRangeComparator.
Clients should implement this interface; there is no standard implementation.
| Method Summary | |
|---|---|
int |
getRangeCount()
Returns the number of comparable entities. |
boolean |
rangesEqual(int thisIndex,
IRangeComparator other,
int otherIndex)
Returns whether the comparable entity given by the first index matches an entity specified by the other IRangeComparator and index. |
boolean |
skipRangeComparison(int length,
int maxLength,
IRangeComparator other)
Returns whether a comparison should be skipped because it would be too costly (or lengthy). |
| Method Detail |
|---|
int getRangeCount()
boolean rangesEqual(int thisIndex,
IRangeComparator other,
int otherIndex)
IRangeComparator and index.
thisIndex - the index of the comparable entity within this IRangeComparatorother - the IRangeComparator to compare this withotherIndex - the index of the comparable entity within the other IRangeComparator
true if 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
true or falsemaxLength - another number on which to base the decision whether to return
true or falseother - the other IRangeComparator to compare with
true to avoid a too lengthy range comparison
|
Eclipse Platform Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2011. All rights reserved.