|
|||||||||
| 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.EmptyTreeIterator
public class EmptyTreeIterator
Iterator over an empty tree (a directory with no files).
| Field Summary |
|---|
| Fields inherited from class org.eclipse.jgit.treewalk.AbstractTreeIterator |
|---|
DEFAULT_PATH_SIZE, mode, path, pathLen, pathOffset, zeroid |
| Constructor Summary | |
|---|---|
EmptyTreeIterator()
Create a new iterator with no parent. |
|
EmptyTreeIterator(AbstractTreeIterator p,
byte[] childPath,
int childPathOffset)
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. |
AbstractTreeIterator |
createSubtreeIterator(Repository repo)
Create a new iterator for the current entry's subtree. |
boolean |
eof()
Is this tree iterator at its EOF point (no more entries)? |
boolean |
first()
Is this tree iterator positioned on its first entry? |
ObjectId |
getEntryObjectId()
Get the object id of the current 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. |
void |
next(int delta)
Move to next entry, populating this iterator with the entry data. |
void |
stopWalk()
Indicates to the iterator that no more entries will be read. |
| Methods inherited from class org.eclipse.jgit.treewalk.AbstractTreeIterator |
|---|
createEmptyTreeIterator, createSubtreeIterator, ensurePathCapacity, getEntryFileMode, getEntryObjectId, getEntryPathString, getEntryRawMode, getName, getNameLength, growPath, idEqual, pathCompare, skip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EmptyTreeIterator()
public EmptyTreeIterator(AbstractTreeIterator p,
byte[] childPath,
int childPathOffset)
The caller is responsible for setting up the path of the child iterator.
p - parent tree iterator.childPath - path array to be used by the child iterator. This path must
contain the path from the top of the walk to the first child
and must end with a '/'.childPathOffset - position within childPath where the child can
insert its data. The value at
childPath[childPathOffset-1] must be '/'.| Method Detail |
|---|
public AbstractTreeIterator createSubtreeIterator(Repository repo)
throws IncorrectObjectTypeException,
java.io.IOException
AbstractTreeIterator
The parent reference of the iterator must be this,
otherwise the caller would not be able to exit out of the subtree
iterator correctly and return to continue walking this.
createSubtreeIterator in class AbstractTreeIteratorrepo - repository to load the tree data from.
IncorrectObjectTypeException - the current entry is not actually a tree and cannot be parsed
as though it were a tree.
java.io.IOException - a loose object or pack file could not be read.public ObjectId getEntryObjectId()
AbstractTreeIterator
getEntryObjectId in class AbstractTreeIteratorpublic 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 void stopWalk()
AbstractTreeIterator
This is only invoked by TreeWalk when the iteration is aborted early due
to a StopWalkException being thrown from
within a TreeFilter.
stopWalk in class AbstractTreeIterator
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||