- java.lang.Object
-
- org.eclipse.jgit.patch.HunkHeader
-
- Direct Known Subclasses:
CombinedHunkHeader
public class HunkHeader extends Object
Hunk header describing the layout of a single block of lines
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHunkHeader.OldImageDetails about an old image of the file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getBuffer()Get the byte array holding this hunk's patch script.intgetEndOffset()Get offset one past the end of the hunk ingetBuffer().FileHeadergetFileHeader()Get header for the file this hunk applies to.intgetLinesContext()Get total number of lines of context appearing in this hunk.intgetNewLineCount()Get total number of post-image lines this hunk covers.intgetNewStartLine()Get first line number in the post-image file where the hunk starts.HunkHeader.OldImagegetOldImage()Get information about the old image mentioned in this hunk.intgetStartOffset()Get offset of the start of this hunk ingetBuffer().EditListtoEditList()Convert to a list describing the content edits performed within the hunk.StringtoString()
-
-
-
Method Detail
-
getFileHeader
public FileHeader getFileHeader()
Get header for the file this hunk applies to.- Returns:
- header for the file this hunk applies to.
-
getBuffer
public byte[] getBuffer()
Get the byte array holding this hunk's patch script.- Returns:
- the byte array holding this hunk's patch script.
-
getStartOffset
public int getStartOffset()
Get offset of the start of this hunk ingetBuffer().- Returns:
- offset of the start of this hunk in
getBuffer().
-
getEndOffset
public int getEndOffset()
Get offset one past the end of the hunk ingetBuffer().- Returns:
- offset one past the end of the hunk in
getBuffer().
-
getOldImage
public HunkHeader.OldImage getOldImage()
Get information about the old image mentioned in this hunk.- Returns:
- information about the old image mentioned in this hunk.
-
getNewStartLine
public int getNewStartLine()
Get first line number in the post-image file where the hunk starts.- Returns:
- first line number in the post-image file where the hunk starts.
-
getNewLineCount
public int getNewLineCount()
Get total number of post-image lines this hunk covers.- Returns:
- total number of post-image lines this hunk covers.
-
getLinesContext
public int getLinesContext()
Get total number of lines of context appearing in this hunk.- Returns:
- total number of lines of context appearing in this hunk.
-
toEditList
public EditList toEditList()
Convert to a list describing the content edits performed within the hunk.- Returns:
- a list describing the content edits performed within the hunk.
-
-