|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jgit.diff.SequenceComparator<HashedSequence<S>> org.eclipse.jgit.diff.HashedSequenceComparator<S>
S
- the base sequence type.public final class HashedSequenceComparator<S extends Sequence>
Wrap another comparator for use with HashedSequence
.
This comparator acts as a proxy for the real comparator, evaluating the
cached hash code before testing the underlying comparator's equality.
Comparators of this type must be used with a HashedSequence
.
To construct an instance of this type use HashedSequencePair
.
Method Summary | |
---|---|
boolean |
equals(HashedSequence<S> a,
int ai,
HashedSequence<S> b,
int bi)
Compare two items to determine if they are equivalent. |
int |
hash(HashedSequence<S> seq,
int ptr)
Get a hash value for an item in a sequence. |
Methods inherited from class org.eclipse.jgit.diff.SequenceComparator |
---|
reduceCommonStartEnd |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public boolean equals(HashedSequence<S> a, int ai, HashedSequence<S> b, int bi)
SequenceComparator
a
with itself (by passing
a
again in position b
).
equals
in class SequenceComparator<HashedSequence<S extends Sequence>>
a
- the first sequence.ai
- item of ai
to compare.b
- the second sequence.bi
- item of bi
to compare.
public int hash(HashedSequence<S> seq, int ptr)
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<HashedSequence<S extends Sequence>>
seq
- the sequence.ptr
- the item to obtain the hash for.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |