|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jgit.diff.SequenceComparator<RawText> org.eclipse.jgit.diff.RawTextComparator
public abstract class RawTextComparator
Equivalence function for RawText
.
Field Summary | |
---|---|
static RawTextComparator |
DEFAULT
No special treatment. |
static RawTextComparator |
WS_IGNORE_ALL
Ignores all whitespace. |
static RawTextComparator |
WS_IGNORE_CHANGE
Ignores whitespace occurring between non-whitespace characters. |
static RawTextComparator |
WS_IGNORE_LEADING
Ignores leading whitespace. |
static RawTextComparator |
WS_IGNORE_TRAILING
Ignores trailing whitespace. |
Constructor Summary | |
---|---|
RawTextComparator()
|
Method Summary | |
---|---|
int |
hash(RawText seq,
int lno)
Get a hash value for an item in a sequence. |
protected abstract int |
hashRegion(byte[] raw,
int ptr,
int end)
Compute a hash code for a region. |
Edit |
reduceCommonStartEnd(RawText a,
RawText b,
Edit e)
Modify the edit to remove common leading and trailing items. |
Methods inherited from class org.eclipse.jgit.diff.SequenceComparator |
---|
equals |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final RawTextComparator DEFAULT
public static final RawTextComparator WS_IGNORE_ALL
public static final RawTextComparator WS_IGNORE_LEADING
public static final RawTextComparator WS_IGNORE_TRAILING
public static final RawTextComparator WS_IGNORE_CHANGE
Constructor Detail |
---|
public RawTextComparator()
Method Detail |
---|
public int hash(RawText seq, int lno)
SequenceComparator
SequenceComparator.equals(Sequence, int, Sequence, int)
method, then this hash
method must produce the same integer result for both items.
It is not required for two items to have different hash values if they
are are unequal according to the equals()
method.
hash
in class SequenceComparator<RawText>
seq
- the sequence.lno
- the item to obtain the hash for.
public Edit reduceCommonStartEnd(RawText a, RawText b, Edit e)
SequenceComparator
e
is reduced in size by moving the beginning A
and B points so the edit does not cover any items that are in common
between the two sequences. The ending A and B points are also shifted to
remove common items from the end of the region.
reduceCommonStartEnd
in class SequenceComparator<RawText>
a
- the first sequence.b
- the second sequence.e
- the edit to start with and update.
e
if it was updated in-place, otherwise a new edit
containing the reduced region.protected abstract int hashRegion(byte[] raw, int ptr, int end)
raw
- the raw file content.ptr
- first byte of the region to hash.end
- 1 past the last byte of the region.
[ptr, end)
of raw.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |