Package org.eclipse.jgit.merge
Class MergeChunk
- java.lang.Object
-
- org.eclipse.jgit.merge.MergeChunk
-
public class MergeChunk extends java.lang.Object
One chunk from a merge result. Each chunk contains a range from a single sequence. In case of conflicts multiple chunks are reported for one conflict. The conflictState tells when conflicts start and end.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MergeChunk.ConflictState
A state telling whether a MergeChunk belongs to a conflict or not.
-
Field Summary
Fields Modifier and Type Field Description private int
begin
private MergeChunk.ConflictState
conflictState
private int
end
private int
sequenceIndex
-
Constructor Summary
Constructors Modifier Constructor Description protected
MergeChunk(int sequenceIndex, int begin, int end, MergeChunk.ConflictState conflictState)
Creates a new empty MergeChunk
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBegin()
Get the first element from the specified sequence which should be included in the merge result.MergeChunk.ConflictState
getConflictState()
Get the state of this chunk.int
getEnd()
Get the end of the range of this chunk.int
getSequenceIndex()
Get the index of the sequence to which this sequence chunks belongs to.
-
-
-
Field Detail
-
sequenceIndex
private final int sequenceIndex
-
begin
private final int begin
-
end
private final int end
-
conflictState
private final MergeChunk.ConflictState conflictState
-
-
Constructor Detail
-
MergeChunk
protected MergeChunk(int sequenceIndex, int begin, int end, MergeChunk.ConflictState conflictState)
Creates a new empty MergeChunk- Parameters:
sequenceIndex
- determines to which sequence this chunks belongs to. Same as inMergeResult.add(int, int, int, org.eclipse.jgit.merge.MergeChunk.ConflictState)
begin
- the first element from the specified sequence which should be included in the merge result. Indexes start with 0.end
- specifies the end of the range to be added. The element this index points to is the first element which not added to the merge result. All elements between begin (including begin) and this element are added.conflictState
- the state of this chunk. SeeMergeChunk.ConflictState
-
-
Method Detail
-
getSequenceIndex
public int getSequenceIndex()
Get the index of the sequence to which this sequence chunks belongs to.- Returns:
- the index of the sequence to which this sequence chunks belongs
to. Same as in
MergeResult.add(int, int, int, org.eclipse.jgit.merge.MergeChunk.ConflictState)
-
getBegin
public int getBegin()
Get the first element from the specified sequence which should be included in the merge result.- Returns:
- the first element from the specified sequence which should be included in the merge result. Indexes start with 0.
-
getEnd
public int getEnd()
Get the end of the range of this chunk.- Returns:
- the end of the range of this chunk. The element this index points to is the first element which not added to the merge result. All elements between begin (including begin) and this element are added.
-
getConflictState
public MergeChunk.ConflictState getConflictState()
Get the state of this chunk.- Returns:
- the state of this chunk. See
MergeChunk.ConflictState
-
-