org.eclipse.jgit.diff
Interface Sequence

All Known Implementing Classes:
RawText

public interface Sequence

Arbitrary sequence of elements with fast comparison support.

A sequence of elements is defined to contain elements in the index range [0, size()), like a standard Java List implementation. Unlike a List, the members of the sequence are not directly obtainable, but element equality can be tested if two Sequences are the same implementation.

An implementation may chose to implement the equals semantic as necessary, including fuzzy matching rules such as ignoring insignificant sub-elements, e.g. ignoring whitespace differences in text.

Implementations of Sequence are primarily intended for use in content difference detection algorithms, to produce an EditList of Edit instances describing how two Sequence instances differ.


Method Summary
 boolean equals(int thisIdx, Sequence other, int otherIdx)
          Determine if the i-th member is equal to the j-th member.
 int size()
           
 

Method Detail

size

int size()
Returns:
total number of items in the sequence.

equals

boolean equals(int thisIdx,
               Sequence other,
               int otherIdx)
Determine if the i-th member is equal to the j-th member.

Implementations must ensure equals(thisIdx,other,otherIdx) returns the same as other.equals(otherIdx,this,thisIdx).

Parameters:
thisIdx - index within this sequence; must be in the range [ 0, this.size() ).
other - another sequence; must be the same implementation class, that is this.getClass() == other.getClass().
otherIdx - index within other sequence; must be in the range [ 0, other.size() ).
Returns:
true if the elements are equal; false if they are not equal.