java.lang.Object
org.eclipse.jgit.internal.storage.reftable.RefCursor
All Implemented Interfaces:
AutoCloseable
Direct Known Subclasses:
MergedReftable.MergedRefCursor, ReftableReader.ObjCursorImpl, ReftableReader.RefCursorImpl

public abstract class RefCursor extends Object implements AutoCloseable
Iterator over references inside a Reftable.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    abstract Ref
    Get reference at the current position.
    abstract boolean
    Check if another reference is available.
    abstract void
    seekPastPrefix(String prefixName)
    Seeks forward to the first ref record lexicographically beyond prefixName that doesn't start with prefixName.
    boolean
    Whether the current reference was deleted.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RefCursor

      public RefCursor()
  • Method Details

    • next

      public abstract boolean next() throws IOException
      Check if another reference is available.
      Returns:
      true if there is another result.
      Throws:
      IOException - references cannot be read.
    • seekPastPrefix

      public abstract void seekPastPrefix(String prefixName) throws IOException
      Seeks forward to the first ref record lexicographically beyond prefixName that doesn't start with prefixName. If there are no more results, skipping some refs won't add new results. E.g if we create a RefCursor that returns only results with a specific prefix, skipping that prefix won't give results that are not part of the original prefix.
      Parameters:
      prefixName - prefix that should be skipped. All previous refs before it will be skipped.
      Throws:
      IOException - references cannot be read.
    • getRef

      public abstract Ref getRef()
      Get reference at the current position.
      Returns:
      reference at the current position.
    • wasDeleted

      public boolean wasDeleted()
      Whether the current reference was deleted.
      Returns:
      true if the current reference was deleted.
    • close

      public abstract void close()
      Specified by:
      close in interface AutoCloseable