Top Description Fields Constructors Methods
org.eclipse.jgit.blame.cache

public Class CacheRegion

extends Object
implements Comparable<CacheRegion>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable
Imports
java.text.MessageFormat, org.eclipse.jgit.internal.JGitText, org.eclipse.jgit.lib.ObjectId

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

Field Summary

Modifier and TypeField and Description
private final int
private final ObjectId
private final String
private final int

Constructor Summary

AccessConstructor and Description
public
CacheRegion(String
location of the file
path
,
ObjectId
commit that is modifying this region
commit
,
int
first line of this region (inclusive)
start
,
int
last line of this region (non-inclusive!)
end
)

A blamed portion of a file

Method Summary

Modifier and TypeMethod and Description
private static void
public int
compareTo(CacheRegion
the object to be compared.
o
)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public int

Returns:

one after last line in this region.
getEnd
()

One after last line in this region (or: last line non-inclusive)

public ObjectId

Returns:

commit for this region
getSourceCommit
()

Commit this region belongs to

public String

Returns:

path in the repo/commit
getSourcePath
()

Path of the file this region belongs to

public int

Returns:

first line of this region.
getStart
()

First line of this region.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

endback to summary
private final int end
sourceCommitback to summary
private final ObjectId sourceCommit
sourcePathback to summary
private final String sourcePath
startback to summary
private final int start

Constructor Detail

CacheRegionback to summary
public CacheRegion(String path, ObjectId commit, int start, int end)

A blamed portion of a file

Parameters
path:String

location of the file

commit:ObjectId

commit that is modifying this region

start:int

first line of this region (inclusive)

end:int

last line of this region (non-inclusive!)

Method Detail

allOrNoneNullback to summary
private static void allOrNoneNull(String path, ObjectId commit)
compareToback to summary
public int compareTo(CacheRegion o)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Parameters
o:CacheRegion

the object to be compared.

Returns:int

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Annotations
@Override
getEndback to summary
public int getEnd()

One after last line in this region (or: last line non-inclusive)

Returns:int

one after last line in this region.

getSourceCommitback to summary
public ObjectId getSourceCommit()

Commit this region belongs to

Returns:ObjectId

commit for this region

getSourcePathback to summary
public String getSourcePath()

Path of the file this region belongs to

Returns:String

path in the repo/commit

getStartback to summary
public int getStart()

First line of this region. Starting by 0, inclusive

Returns:int

first line of this region.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@SuppressWarnings:nls
@Override