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 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:
      hasNext in interface Iterator<PackIndex.MutableEntry>
    • next

      public PackIndex.MutableEntry next()
      Implementation must update returnedNumber before returning element.
      Specified by:
      next in interface Iterator<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) and setOffset(long).

    • setIdBuffer

      protected void setIdBuffer(int[] raw, int idx)
      Copies to the entry an ObjectId from the int buffer and position idx
      Parameters:
      raw - the raw data
      idx - the index into raw
    • setIdBuffer

      protected void setIdBuffer(byte[] raw, int idx)
      Copies to the entry an ObjectId from the byte array at position idx.
      Parameters:
      raw - the raw data
      idx - the index into raw
    • setOffset

      protected void setOffset(long offset)
      Sets the offset to the entry
      Parameters:
      offset - the offset in the pack file
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<PackIndex.MutableEntry>