E
- type of subclass of RevCommit the list is storing.public class RevCommitList<E extends RevCommit> extends RevObjectList<E>
RevCommit
subclasses.RevObjectList.Block
contents, size
modCount
Constructor and Description |
---|
RevCommitList() |
Modifier and Type | Method and Description |
---|---|
void |
applyFlag(RevFilter matching,
RevFlag flag)
Apply a flag to all commits matching the specified filter.
|
void |
applyFlag(RevFilter matching,
RevFlag flag,
int rangeBegin,
int rangeEnd)
Apply a flag to all commits matching the specified filter.
|
void |
clear() |
void |
clearFlag(RevFlag flag)
Remove the given flag from all commits.
|
void |
clearFlag(RevFlag flag,
int rangeBegin,
int rangeEnd)
Remove the given flag from all commits.
|
protected void |
enter(int index,
E e)
Optional callback invoked when commits enter the list by fillTo.
|
void |
fillTo(int highMark)
Ensure this list contains at least a specified number of commits.
|
void |
fillTo(RevCommit commitToLoad,
int highMark)
Ensures all commits until the given commit are loaded.
|
int |
indexOf(RevFlag flag,
int begin)
Find the next commit that has the given flag set.
|
boolean |
isPending()
Is this list still pending more items?
|
int |
lastIndexOf(RevFlag flag,
int begin)
Find the next commit that has the given flag set.
|
void |
source(RevWalk w)
Set the revision walker this list populates itself from.
|
add, get, set, size
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
public void clear()
public void applyFlag(RevFilter matching, RevFlag flag) throws MissingObjectException, IncorrectObjectTypeException, IOException
Same as applyFlag(matching, flag, 0, size())
, but without
the incremental behavior.
matching
- 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
- the flag to apply (or remove). Applications are responsible
for allocating this flag from the source RevWalk.IOException
- revision filter needed to read additional objects, but an
error occurred while reading the pack files or loose objects
of the repository.IncorrectObjectTypeException
- revision filter needed to read additional objects, but an
object was not of the correct type. Repository corruption may
have occurred.MissingObjectException
- revision filter needed to read additional objects, but an
object that should be present was not found. Repository
corruption may have occurred.public void applyFlag(RevFilter matching, RevFlag flag, int rangeBegin, int rangeEnd) throws MissingObjectException, IncorrectObjectTypeException, IOException
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.
matching
- 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
- the flag to apply (or remove). Applications are responsible
for allocating this flag from the source RevWalk.rangeBegin
- first commit within the list to begin testing at, inclusive.
Must not be negative, but may be beyond the end of the list.rangeEnd
- last commit within the list to end testing at, exclusive. If
smaller than or equal to rangeBegin
then no
commits will be tested.IOException
- revision filter needed to read additional objects, but an
error occurred while reading the pack files or loose objects
of the repository.IncorrectObjectTypeException
- revision filter needed to read additional objects, but an
object was not of the correct type. Repository corruption may
have occurred.MissingObjectException
- revision filter needed to read additional objects, but an
object that should be present was not found. Repository
corruption may have occurred.public void clearFlag(RevFlag flag)
Same as clearFlag(flag, 0, size())
, but without the
incremental behavior.
flag
- the flag to remove. Applications are responsible for
allocating this flag from the source RevWalk.public void clearFlag(RevFlag flag, int rangeBegin, int rangeEnd)
This method is actually implemented in terms of:
applyFlag(RevFilter.NONE, flag, rangeBegin, rangeEnd)
.
flag
- the flag to remove. Applications are responsible for
allocating this flag from the source RevWalk.rangeBegin
- first commit within the list to begin testing at, inclusive.
Must not be negative, but may be beyond the end of the list.rangeEnd
- last commit within the list to end testing at, exclusive. If
smaller than or equal to rangeBegin
then no
commits will be tested.public int indexOf(RevFlag flag, int begin)
flag
- the flag to test commits against.begin
- first commit index to test at. Applications may wish to begin
at 0, to test the first commit in the list.begin
that has the specified flag set on it; -1 if no match is found.public int lastIndexOf(RevFlag flag, int begin)
flag
- the flag to test commits against.begin
- first commit index to test at. Applications may wish to begin
at size()-1
, to test the last commit in the
list.begin
that has the specified flag set on it; -1 if no match is found.public void source(RevWalk w)
w
- the walker to populate from.fillTo(int)
public boolean isPending()
fillTo(int)
might be able to extend the list
size when called.public void fillTo(int highMark) throws MissingObjectException, IncorrectObjectTypeException, IOException
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 RevObjectList.size()
to
determine if the high water mark specified was met.
highMark
- number of commits the caller wants this list to contain when
the fill operation is complete.IOException
- see RevWalk.next()
IncorrectObjectTypeException
- see RevWalk.next()
MissingObjectException
- see RevWalk.next()
public void fillTo(RevCommit commitToLoad, int highMark) throws MissingObjectException, IncorrectObjectTypeException, IOException
source(RevWalk)
is pumped until the
specified commit is loaded. Callers can test the final size of the list
by RevObjectList.size()
to determine if the high water mark specified was met.
commitToLoad
- commit the caller wants this list to contain when the fill
operation is complete.highMark
- 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.IOException
- see RevWalk.next()
IncorrectObjectTypeException
- see RevWalk.next()
MissingObjectException
- see RevWalk.next()
protected void enter(int index, E e)
This method is only called during fillTo(int)
.
index
- the list position this object will appear at.e
- the object being added (or set) into the list.Copyright © 2019 Eclipse JGit Project. All rights reserved.