Module org.eclipse.jgit
Class PackIndex.EntriesIterator
java.lang.Object
org.eclipse.jgit.internal.storage.file.PackIndex.EntriesIterator
- All Implemented Interfaces:
Iterator<PackIndex.MutableEntry>
- Enclosing interface:
- PackIndex
public abstract static class PackIndex.EntriesIterator
extends Object
implements Iterator<PackIndex.MutableEntry>
Base implementation of the iterator over index entries.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEntriesIterator(long objectCount) Construct an iterator that can move objectCount times forward. -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasNext()next()Implementation must updatereturnedNumberbefore returning element.protected abstract voidreadNext()Used by subclasses to load the next entry into the MutableEntry.voidremove()protected voidsetIdBuffer(byte[] raw, int idx) Copies to the entry anObjectIdfrom the byte array at position idx.protected voidsetIdBuffer(int[] raw, int idx) Copies to the entry anObjectIdfrom the int buffer and position idxprotected voidsetOffset(long offset) Sets theoffsetto the entryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
EntriesIterator
protected EntriesIterator(long objectCount) Construct an iterator that can move objectCount times forward.- Parameters:
objectCount- the number of objects in the PackFile.
-
-
Method Details
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceIterator<PackIndex.MutableEntry>
-
next
Implementation must updatereturnedNumberbefore returning element.- Specified by:
nextin interfaceIterator<PackIndex.MutableEntry>
-
readNext
protected abstract void readNext()Used by subclasses to load the next entry into the MutableEntry.Subclasses are expected to populate the entry with
setIdBuffer(int[], int)andsetOffset(long). -
setIdBuffer
protected void setIdBuffer(int[] raw, int idx) Copies to the entry anObjectIdfrom the int buffer and position idx- Parameters:
raw- the raw dataidx- the index intoraw
-
setIdBuffer
protected void setIdBuffer(byte[] raw, int idx) Copies to the entry anObjectIdfrom the byte array at position idx.- Parameters:
raw- the raw dataidx- the index intoraw
-
setOffset
protected void setOffset(long offset) Sets theoffsetto the entry- Parameters:
offset- the offset in the pack file
-
remove
public void remove()- Specified by:
removein interfaceIterator<PackIndex.MutableEntry>
-