Class CacheRegion

java.lang.Object
org.eclipse.jgit.blame.cache.CacheRegion
All Implemented Interfaces:
Comparable<CacheRegion>

public class CacheRegion extends Object implements Comparable<CacheRegion>
Region of the blame of a file.

Usually all parameters are non-null, except when the Region was created to fill an unblamed gap (to cover for bugs in the calculation). In that case, path, commit and author will be null.

Since:
7.2
  • Constructor Details

    • CacheRegion

      public CacheRegion(String path, ObjectId commit, int start, int end)
      A blamed portion of a file
      Parameters:
      path - location of the file
      commit - commit that is modifying this region
      start - first line of this region (inclusive)
      end - last line of this region (non-inclusive!)
  • Method Details

    • getStart

      public int getStart()
      First line of this region. Starting by 0, inclusive
      Returns:
      first line of this region.
    • getEnd

      public int getEnd()
      One after last line in this region (or: last line non-inclusive)
      Returns:
      one after last line in this region.
    • getSourcePath

      public String getSourcePath()
      Path of the file this region belongs to
      Returns:
      path in the repo/commit
    • getSourceCommit

      public ObjectId getSourceCommit()
      Commit this region belongs to
      Returns:
      commit for this region
    • compareTo

      public int compareTo(CacheRegion o)
      Specified by:
      compareTo in interface Comparable<CacheRegion>
    • toString

      public String toString()
      Overrides:
      toString in class Object