|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.jgit.treewalk.AbstractTreeIterator
org.eclipse.jgit.treewalk.WorkingTreeIterator
public abstract class WorkingTreeIterator
Walks a working directory tree as part of a TreeWalk.
Most applications will want to use the standard implementation of this
iterator, FileTreeIterator, as that does all IO through the standard
java.io package. Plugins for a Java based IDE may however wish
to create their own implementations of this class to allow traversal of the
IDE's project space, as well as benefit from any caching the IDE may have.
FileTreeIterator| Nested Class Summary | |
|---|---|
protected static class |
WorkingTreeIterator.Entry
A single entry within a working directory tree. |
| Field Summary | |
|---|---|
protected static WorkingTreeIterator.Entry[] |
EOF
An empty entry array, suitable for init(Entry[]). |
| Fields inherited from class org.eclipse.jgit.treewalk.AbstractTreeIterator |
|---|
DEFAULT_PATH_SIZE, mode, path, pathLen, pathOffset, zeroid |
| Constructor Summary | |
|---|---|
protected |
WorkingTreeIterator()
Create a new iterator with no parent. |
protected |
WorkingTreeIterator(java.lang.String prefix)
Create a new iterator with no parent and a prefix. |
protected |
WorkingTreeIterator(WorkingTreeIterator p)
Create an iterator for a subtree of an existing iterator. |
| Method Summary | |
|---|---|
void |
back(int delta)
Move to prior entry, populating this iterator with the entry data. |
protected WorkingTreeIterator.Entry |
current()
Obtain the current entry from this iterator. |
boolean |
eof()
Is this tree iterator at its EOF point (no more entries)? |
boolean |
first()
Is this tree iterator positioned on its first entry? |
long |
getEntryLastModified()
Get the last modified time of this entry. |
long |
getEntryLength()
Get the byte length of this entry. |
byte[] |
idBuffer()
Get the byte array buffer object IDs must be copied out of. |
int |
idOffset()
Get the position within AbstractTreeIterator.idBuffer() of this entry's ObjectId. |
protected void |
init(WorkingTreeIterator.Entry[] list)
Constructor helper. |
void |
next(int delta)
Move to next entry, populating this iterator with the entry data. |
| Methods inherited from class org.eclipse.jgit.treewalk.AbstractTreeIterator |
|---|
createEmptyTreeIterator, createSubtreeIterator, createSubtreeIterator, ensurePathCapacity, getEntryFileMode, getEntryObjectId, getEntryObjectId, getEntryPathString, getEntryRawMode, getName, getNameLength, growPath, idEqual, pathCompare, skip, stopWalk |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final WorkingTreeIterator.Entry[] EOF
init(Entry[]).
| Constructor Detail |
|---|
protected WorkingTreeIterator()
protected WorkingTreeIterator(java.lang.String prefix)
The prefix path supplied is inserted in front of all paths generated by this iterator. It is intended to be used when an iterator is being created for a subsection of an overall repository and needs to be combined with other iterators that are created to run over the entire repository namespace.
prefix - position of this iterator in the repository tree. The value
may be null or the empty string to indicate the prefix is the
root of the repository. A trailing slash ('/') is
automatically appended if the prefix does not end in '/'.protected WorkingTreeIterator(WorkingTreeIterator p)
p - parent tree iterator.| Method Detail |
|---|
public byte[] idBuffer()
AbstractTreeIteratorThe id buffer contains the bytes necessary to construct an ObjectId for the current entry of this iterator. The buffer can be the same buffer for all entries, or it can be a unique buffer per-entry. Implementations are encouraged to expose their private buffer whenever possible to reduce garbage generation and copying costs.
idBuffer in class AbstractTreeIteratorAbstractTreeIterator.getEntryObjectId()public int idOffset()
AbstractTreeIteratorAbstractTreeIterator.idBuffer() of this entry's ObjectId.
idOffset in class AbstractTreeIteratorAbstractTreeIterator.idBuffer() where the
ObjectId must be copied out of.public boolean first()
AbstractTreeIterator
An iterator is positioned on the first entry if back(1)
would be an invalid request as there is no entry before the current one.
An empty iterator (one with no entries) will be
first() && eof().
first in class AbstractTreeIteratorpublic boolean eof()
AbstractTreeIteratorAn iterator is at EOF if there is no current entry.
eof in class AbstractTreeIterator
public void next(int delta)
throws CorruptObjectException
AbstractTreeIteratorThe delta indicates how many moves forward should occur. The most common delta is 1 to move to the next entry.
Implementations must populate the following members:
AbstractTreeIterator.modeAbstractTreeIterator.path (from AbstractTreeIterator.pathOffset to AbstractTreeIterator.pathLen)AbstractTreeIterator.pathLenAbstractTreeIterator.idBuffer() and AbstractTreeIterator.idOffset()
when demanded.
next in class AbstractTreeIteratordelta - number of entries to move the iterator by. Must be a positive,
non-zero integer.
CorruptObjectException - the tree is invalid.
public void back(int delta)
throws CorruptObjectException
AbstractTreeIteratorThe delta indicates how many moves backward should occur.The most common delta is 1 to move to the prior entry.
Implementations must populate the following members:
AbstractTreeIterator.modeAbstractTreeIterator.path (from AbstractTreeIterator.pathOffset to AbstractTreeIterator.pathLen)AbstractTreeIterator.pathLenAbstractTreeIterator.idBuffer() and AbstractTreeIterator.idOffset()
when demanded.
back in class AbstractTreeIteratordelta - number of entries to move the iterator by. Must be a positive,
non-zero integer.
CorruptObjectException - the tree is invalid.public long getEntryLength()
public long getEntryLastModified()
protected void init(WorkingTreeIterator.Entry[] list)
list - files in the subtree of the work tree this iterator operates
onprotected WorkingTreeIterator.Entry current()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||