Class RefCursor
java.lang.Object
org.eclipse.jgit.internal.storage.reftable.RefCursor
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
MergedReftable.MergedRefCursor,ReftableReader.ObjCursorImpl,ReftableReader.RefCursorImpl
Iterator over references inside a
Reftable.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclose()abstract RefgetRef()Get reference at the current position.abstract booleannext()Check if another reference is available.abstract voidseekPastPrefix(String prefixName) Seeks forward to the first ref record lexicographically beyondprefixNamethat doesn't start withprefixName.booleanWhether the current reference was deleted.
-
Constructor Details
-
RefCursor
public RefCursor()
-
-
Method Details
-
next
Check if another reference is available.- Returns:
trueif there is another result.- Throws:
IOException- references cannot be read.
-
seekPastPrefix
Seeks forward to the first ref record lexicographically beyondprefixNamethat doesn't start withprefixName. 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
Get reference at the current position.- Returns:
- reference at the current position.
-
wasDeleted
public boolean wasDeleted()Whether the current reference was deleted.- Returns:
trueif the current reference was deleted.
-
close
public abstract void close()- Specified by:
closein interfaceAutoCloseable
-