Top Description Fields Constructors Methods
org.eclipse.jgit.revwalk

public Class RevCommitList<E extends RevCommit>

extends RevObjectList<E extends RevCommit>
Class Inheritance
Known Direct Subclasses
org.eclipse.jgit.revplot.PlotCommitList
Type Parameters
<E>
type of subclass of RevCommit the list is storing.
Imports
java.io.IOException, org.eclipse.jgit.errors.IncorrectObjectTypeException, .MissingObjectException, org.eclipse.jgit.revwalk.filter.RevFilter

An ordered list of org.eclipse.jgit.revwalk.RevCommit subclasses.

Field Summary

Modifier and TypeField and Description
private RevWalk
Inherited from org.eclipse.jgit.revwalk.RevObjectList:
BLOCK_SHIFTBLOCK_SIZEcontentssize

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
applyFlag(RevFilter
the filter to test commits with. If the filter includes a commit it will have the flag set; if the filter does not include the commit the flag will be unset.
matching
,
RevFlag
the flag to apply (or remove). Applications are responsible for allocating this flag from the source RevWalk.
flag
)

Apply a flag to all commits matching the specified filter.

public void
applyFlag(final RevFilter
the filter to test commits with. If the filter includes a commit it will have the flag set; if the filter does not include the commit the flag will be unset.
matching
,
final RevFlag
the flag to apply (or remove). Applications are responsible for allocating this flag from the source RevWalk.
flag
,
int
first commit within the list to begin testing at, inclusive. Must not be negative, but may be beyond the end of the list.
rangeBegin
,
int
last commit within the list to end testing at, exclusive. If smaller than or equal to rangeBegin then no commits will be tested.
rangeEnd
)

Apply a flag to all commits matching the specified filter.

public void
clear()

Overrides org.eclipse.jgit.revwalk.RevObjectList.clear.

Implements java.util.List.clear, java.util.Collection.clear.

Removes all of the elements from this list (optional operation).

public void
clearFlag(RevFlag
the flag to remove. Applications are responsible for allocating this flag from the source RevWalk.
flag
)

Remove the given flag from all commits.

public void
clearFlag(final RevFlag
the flag to remove. Applications are responsible for allocating this flag from the source RevWalk.
flag
,
final int
first commit within the list to begin testing at, inclusive. Must not be negative, but may be beyond the end of the list.
rangeBegin
,
final int
last commit within the list to end testing at, exclusive. If smaller than or equal to rangeBegin then no commits will be tested.
rangeEnd
)

Remove the given flag from all commits.

protected void
enter(int
the list position this object will appear at.
index
,
E
the object being added (or set) into the list.
e
)

Optional callback invoked when commits enter the list by fillTo.

public void
fillTo(int
number of commits the caller wants this list to contain when the fill operation is complete.
highMark
)

Ensure this list contains at least a specified number of commits.

public void
fillTo(RevCommit
commit the caller wants this list to contain when the fill operation is complete.
commitToLoad
,
int
maximum number of commits the caller wants this list to contain when the fill operation is complete. If highMark is 0 the walk is pumped until the specified commit or the end of the walk is reached.
highMark
)

Ensures all commits until the given commit are loaded.

public int

Returns:

index of the first commit at or after index begin that has the specified flag set on it; -1 if no match is found.
indexOf
(RevFlag
the flag to test commits against.
flag
,
int
first commit index to test at. Applications may wish to begin at 0, to test the first commit in the list.
begin
)

Find the next commit that has the given flag set.

public boolean

Returns:

true if fillTo(int) might be able to extend the list size when called.
isPending
()

Is this list still pending more items?

public int

Returns:

index of the first commit at or before index begin that has the specified flag set on it; -1 if no match is found.
lastIndexOf
(RevFlag
the flag to test commits against.
flag
,
int
first commit index to test at. Applications may wish to begin at size()-1, to test the last commit in the list.
begin
)

Find the next commit that has the given flag set.

public void
source(RevWalk
the walker to populate from.
w
)

Set the revision walker this list populates itself from.

Inherited from org.eclipse.jgit.revwalk.RevObjectList:
addgetsetsize

Field Detail

walkerback to summary
private RevWalk walker

Constructor Detail

RevCommitListback to summary
public RevCommitList()

Method Detail

applyFlagback to summary
public void applyFlag(RevFilter matching, RevFlag flag) throws MissingObjectException, IncorrectObjectTypeException, IOException

Apply a flag to all commits matching the specified filter.

Same as applyFlag(matching, flag, 0, size()), but without the incremental behavior.

Parameters
matching:RevFilter

the filter to test commits with. If the filter includes a commit it will have the flag set; if the filter does not include the commit the flag will be unset.

flag:RevFlag

the flag to apply (or remove). Applications are responsible for allocating this flag from the source RevWalk.

Exceptions
MissingObjectException:
revision filter needed to read additional objects, but an object that should be present was not found. Repository corruption may have occurred.
IncorrectObjectTypeException:
revision filter needed to read additional objects, but an object was not of the correct type. Repository corruption may have occurred.
IOException:
revision filter needed to read additional objects, but an error occurred while reading the pack files or loose objects of the repository.
applyFlagback to summary
public void applyFlag(final RevFilter matching, final RevFlag flag, int rangeBegin, int rangeEnd) throws MissingObjectException, IncorrectObjectTypeException, IOException

Apply a flag to all commits matching the specified filter.

This version allows incremental testing and application, such as from a background thread that needs to periodically halt processing and send updates to the UI.

Parameters
matching:RevFilter

the filter to test commits with. If the filter includes a commit it will have the flag set; if the filter does not include the commit the flag will be unset.

flag:RevFlag

the flag to apply (or remove). Applications are responsible for allocating this flag from the source RevWalk.

rangeBegin:int

first commit within the list to begin testing at, inclusive. Must not be negative, but may be beyond the end of the list.

rangeEnd:int

last commit within the list to end testing at, exclusive. If smaller than or equal to rangeBegin then no commits will be tested.

Exceptions
MissingObjectException:
revision filter needed to read additional objects, but an object that should be present was not found. Repository corruption may have occurred.
IncorrectObjectTypeException:
revision filter needed to read additional objects, but an object was not of the correct type. Repository corruption may have occurred.
IOException:
revision filter needed to read additional objects, but an error occurred while reading the pack files or loose objects of the repository.
clearback to summary
public void clear()

Overrides org.eclipse.jgit.revwalk.RevObjectList.clear.

Implements java.util.List.clear, java.util.Collection.clear.

Doc from java.util.AbstractList.clear.

Removes all of the elements from this list (optional operation). The list will be empty after this call returns.

Annotations
@Override
clearFlagback to summary
public void clearFlag(RevFlag flag)

Remove the given flag from all commits.

Same as clearFlag(flag, 0, size()), but without the incremental behavior.

Parameters
flag:RevFlag

the flag to remove. Applications are responsible for allocating this flag from the source RevWalk.

clearFlagback to summary
public void clearFlag(final RevFlag flag, final int rangeBegin, final int rangeEnd)

Remove the given flag from all commits.

This method is actually implemented in terms of: applyFlag(RevFilter.NONE, flag, rangeBegin, rangeEnd).

Parameters
flag:RevFlag

the flag to remove. Applications are responsible for allocating this flag from the source RevWalk.

rangeBegin:int

first commit within the list to begin testing at, inclusive. Must not be negative, but may be beyond the end of the list.

rangeEnd:int

last commit within the list to end testing at, exclusive. If smaller than or equal to rangeBegin then no commits will be tested.

enterback to summary
protected void enter(int index, E e)

Optional callback invoked when commits enter the list by fillTo.

This method is only called during fillTo(int).

Parameters
index:int

the list position this object will appear at.

e:E

the object being added (or set) into the list.

fillToback to summary
public void fillTo(int highMark) throws MissingObjectException, IncorrectObjectTypeException, IOException

Ensure this list contains at least a specified number of commits.

The revision walker specified by source(RevWalk) is pumped until the given number of commits are contained in this list. If there are fewer total commits available from the walk then the method will return early. Callers can test the final size of the list by size() to determine if the high water mark specified was met.

Parameters
highMark:int

number of commits the caller wants this list to contain when the fill operation is complete.

Annotations
@SuppressWarnings:unchecked
Exceptions
MissingObjectException:
see org.eclipse.jgit.revwalk.RevWalk#next()
IncorrectObjectTypeException:
see org.eclipse.jgit.revwalk.RevWalk#next()
IOException:
see org.eclipse.jgit.revwalk.RevWalk#next()
fillToback to summary
public void fillTo(RevCommit commitToLoad, int highMark) throws MissingObjectException, IncorrectObjectTypeException, IOException

Ensures all commits until the given commit are loaded. The revision walker specified by source(RevWalk) is pumped until the specified commit is loaded. Callers can test the final size of the list by size() to determine if the high water mark specified was met.

Parameters
commitToLoad:RevCommit

commit the caller wants this list to contain when the fill operation is complete.

highMark:int

maximum number of commits the caller wants this list to contain when the fill operation is complete. If highMark is 0 the walk is pumped until the specified commit or the end of the walk is reached.

Annotations
@SuppressWarnings:unchecked
Exceptions
MissingObjectException:
see org.eclipse.jgit.revwalk.RevWalk#next()
IncorrectObjectTypeException:
see org.eclipse.jgit.revwalk.RevWalk#next()
IOException:
see org.eclipse.jgit.revwalk.RevWalk#next()
indexOfback to summary
public int indexOf(RevFlag flag, int begin)

Find the next commit that has the given flag set.

Parameters
flag:RevFlag

the flag to test commits against.

begin:int

first commit index to test at. Applications may wish to begin at 0, to test the first commit in the list.

Returns:int

index of the first commit at or after index begin that has the specified flag set on it; -1 if no match is found.

isPendingback to summary
public boolean isPending()

Is this list still pending more items?

Returns:boolean

true if fillTo(int) might be able to extend the list size when called.

lastIndexOfback to summary
public int lastIndexOf(RevFlag flag, int begin)

Find the next commit that has the given flag set.

Parameters
flag:RevFlag

the flag to test commits against.

begin:int

first commit index to test at. Applications may wish to begin at size()-1, to test the last commit in the list.

Returns:int

index of the first commit at or before index begin that has the specified flag set on it; -1 if no match is found.

sourceback to summary
public void source(RevWalk w)

Set the revision walker this list populates itself from.

Parameters
w:RevWalk

the walker to populate from.

See Also
fillTo(int)