A result is usually updated incrementally as the BlameGenerator digs back further through history. Applications that want to lay annotations down text to the original source file in a viewer may find the BlameResult structure an easy way to acquire the information, at the expense of keeping tables in memory tracking every line of the result file.
This class is not thread-safe.
During blame processing there are two files involved:
| Modifier and Type | Field and Description |
|---|---|
| private BlameGenerator | |
| private int | |
| private RawText | |
| private final String | |
| private final PersonIdent[] | |
| private final RevCommit[] | |
| private final PersonIdent[] | |
| private final int[] | sourceLines
Warning these are actually 1-based. |
| private final String[] |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public int | Returns: index that is now available. -1 if no more are available.Compute the next available segment and return the first index. |
| public void | computeRange(int
first index to examine (inclusive). start, int end index (exclusive). end)Compute until the entire range has been populated. |
| public static BlameResult | Returns: the new result object. null if the generator cannot find the path it starts from.the generator the result will consume records from. gen)Construct a new BlameResult for a generator. |
| public void | |
| public RawText | |
| public String | |
| public PersonIdent | Returns: author that provided lineidx. May be null.line to read data of, 0 based. idx)Get the author that provided the specified line of the result. |
| public RevCommit | Returns: commit that provided lineidx. May be null.line to read data of, 0 based. idx)Get the commit that provided the specified line of the result. |
| public PersonIdent | Returns: committer that provided lineidx. May be null.line to read data of, 0 based. idx)Get the committer that provided the specified line of the result. |
| public int | Returns: matching line number in the source file.line to read data of, 0 based. idx)Get the corresponding line number in the source file. |
| public String | Returns: source file path that provided lineidx.line to read data of, 0 based. idx)Get the file path that provided the specified line of the result. |
| public boolean | Returns: true if the data has been annotated, false otherwise.line to read data of, 0 based. idx)Check if the given result line has been annotated yet. |
| public boolean | Returns: true if the data has been annotated, false otherwise.first index to examine. start, int last index to examine. end)Check if the given result line has been annotated yet. |
| public int | |
| private void | |
| public String |
| generator | back to summary |
|---|---|
| private BlameGenerator generator | |
| lastLength | back to summary |
|---|---|
| private int lastLength | |
| resultContents | back to summary |
|---|---|
| private RawText resultContents | |
| resultPath | back to summary |
|---|---|
| private final String resultPath | |
| sourceAuthors | back to summary |
|---|---|
| private final PersonIdent[] sourceAuthors | |
| sourceCommits | back to summary |
|---|---|
| private final RevCommit[] sourceCommits | |
| sourceCommitters | back to summary |
|---|---|
| private final PersonIdent[] sourceCommitters | |
| sourceLines | back to summary |
|---|---|
| private final int[] sourceLines Warning these are actually 1-based. | |
| sourcePaths | back to summary |
|---|---|
| private final String[] sourcePaths | |
| BlameResult | back to summary |
|---|---|
| pack-priv BlameResult(BlameGenerator bg, String path, RawText text) | |
| computeAll | back to summary |
|---|---|
| public void computeAll() throws IOException Compute all pending information.
| |
| computeNext | back to summary |
|---|---|
| public int computeNext() throws IOException Compute the next available segment and return the first index.
Computes one segment and returns to the caller the first index that is
available. After return the caller can also inspect
| |
| computeRange | back to summary |
|---|---|
| public void computeRange(int start, int end) throws IOException Compute until the entire range has been populated.
| |
| create | back to summary |
|---|---|
| public static BlameResult create(BlameGenerator gen) throws IOException Construct a new BlameResult for a generator.
| |
| discardResultContents | back to summary |
|---|---|
| public void discardResultContents() Throw away the | |
| getResultContents | back to summary |
|---|---|
| public RawText getResultContents() Get result contents
| |
| getResultPath | back to summary |
|---|---|
| public String getResultPath() Get result path
| |
| getSourceAuthor | back to summary |
|---|---|
| public PersonIdent getSourceAuthor(int idx) Get the author that provided the specified line of the result.
| |
| getSourceCommit | back to summary |
|---|---|
| public RevCommit getSourceCommit(int idx) Get the commit that provided the specified line of the result. The source commit may be null if the line was blamed to an uncommitted revision, such as the working tree copy, or during a reverse blame if the line survives to the end revision (e.g. the branch tip).
| |
| getSourceCommitter | back to summary |
|---|---|
| public PersonIdent getSourceCommitter(int idx) Get the committer that provided the specified line of the result.
| |
| getSourceLine | back to summary |
|---|---|
| public int getSourceLine(int idx) Get the corresponding line number in the source file.
| |
| getSourcePath | back to summary |
|---|---|
| public String getSourcePath(int idx) Get the file path that provided the specified line of the result.
| |
| hasSourceData | back to summary |
|---|---|
| public boolean hasSourceData(int idx) Check if the given result line has been annotated yet.
| |
| hasSourceData | back to summary |
|---|---|
| public boolean hasSourceData(int start, int end) Check if the given result line has been annotated yet.
| |
| lastLength | back to summary |
|---|---|
| public int lastLength() Get last length
| |
| loadFrom | back to summary |
|---|---|
| private void loadFrom(BlameGenerator gen) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |