org.eclipse.jgit.diff
Class LowLevelDiffAlgorithm

java.lang.Object
  extended by org.eclipse.jgit.diff.DiffAlgorithm
      extended by org.eclipse.jgit.diff.LowLevelDiffAlgorithm
Direct Known Subclasses:
HistogramDiff

public abstract class LowLevelDiffAlgorithm
extends DiffAlgorithm

Compares two sequences primarily based upon hash codes.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jgit.diff.DiffAlgorithm
DiffAlgorithm.SupportedAlgorithm
 
Constructor Summary
LowLevelDiffAlgorithm()
           
 
Method Summary
abstract
<S extends Sequence>
void
diffNonCommon(EditList edits, HashedSequenceComparator<S> cmp, HashedSequence<S> a, HashedSequence<S> b, Edit region)
          Compare two sequences and identify a list of edits between them.
<S extends Sequence>
EditList
diffNonCommon(SequenceComparator<? super S> cmp, S a, S b)
          Compare two sequences and identify a list of edits between them.
 
Methods inherited from class org.eclipse.jgit.diff.DiffAlgorithm
diff, getAlgorithm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LowLevelDiffAlgorithm

public LowLevelDiffAlgorithm()
Method Detail

diffNonCommon

public <S extends Sequence> EditList diffNonCommon(SequenceComparator<? super S> cmp,
                                                   S a,
                                                   S b)
Description copied from class: DiffAlgorithm
Compare two sequences and identify a list of edits between them. This method should be invoked only after the two sequences have been proven to have no common starting or ending elements. The expected elimination of common starting and ending elements is automatically performed by the DiffAlgorithm.diff(SequenceComparator, Sequence, Sequence) method, which invokes this method using Subsequences.

Specified by:
diffNonCommon in class DiffAlgorithm
Type Parameters:
S - type of sequence being compared.
Parameters:
cmp - the comparator supplying the element equivalence function.
a - the first (also known as old or pre-image) sequence. Edits returned by this algorithm will reference indexes using the 'A' side: Edit.getBeginA(), Edit.getEndA().
b - the second (also known as new or post-image) sequence. Edits returned by this algorithm will reference indexes using the 'B' side: Edit.getBeginB(), Edit.getEndB().
Returns:
a modifiable edit list comparing the two sequences.

diffNonCommon

public abstract <S extends Sequence> void diffNonCommon(EditList edits,
                                                        HashedSequenceComparator<S> cmp,
                                                        HashedSequence<S> a,
                                                        HashedSequence<S> b,
                                                        Edit region)
Compare two sequences and identify a list of edits between them. This method should be invoked only after the two sequences have been proven to have no common starting or ending elements. The expected elimination of common starting and ending elements is automatically performed by the DiffAlgorithm.diff(SequenceComparator, Sequence, Sequence) method, which invokes this method using Subsequences.

Type Parameters:
S - type of sequence being compared.
Parameters:
edits - result list to append the region's edits onto.
cmp - the comparator supplying the element equivalence function.
a - the first (also known as old or pre-image) sequence. Edits returned by this algorithm will reference indexes using the 'A' side: Edit.getBeginA(), Edit.getEndA().
b - the second (also known as new or post-image) sequence. Edits returned by this algorithm will reference indexes using the 'B' side: Edit.getBeginB(), Edit.getEndB().
region - the region being compared within the two sequences.


Copyright © 2012. All Rights Reserved.