Top Description Fields Constructors Methods
org.eclipse.jgit.internal.storage.reftable

public abstract Class Reftable

extends Object
Class Inheritance
Known Direct Subclasses
org.eclipse.jgit.internal.storage.reftable.ReftableReader, org.eclipse.jgit.internal.storage.reftable.MergedReftable
Static Imports
org.eclipse.jgit.lib.RefDatabase.MAX_SYMBOLIC_REF_DEPTH

Abstract table of references.

Field Summary

Modifier and TypeField and Description
protected boolean
includeDeletes

true if deletions should be included in results.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract LogCursor

Returns:

cursor to iterate; empty cursor if no logs are present.
allLogs
()

Seek reader to read log records.

public abstract RefCursor

Returns:

cursor to iterate.
allRefs
()

Seek to the first reference, to iterate in order.

public abstract RefCursor

Returns:

cursor to iterate; empty cursor if no references match.
byObjectId
(AnyObjectId
object to find.
id
)

Match references pointing to a specific object.

public Ref

Returns:

the reference, or null if not found.
exactRef
(String
reference name to find.
refName
)

Lookup a reference, or null if not found.

public static Reftable

Returns:

a reader for the supplied references.
from
(Collection<Ref>
references to convert into a reftable; may be empty.
refs
)

References to convert into a reftable

public boolean

Returns:

true if any reference exists directly referencing id, or a annotated tag that peels to id.
hasId
(AnyObjectId
ObjectId to find.
id
)

Test if any reference directly refers to the object.

public abstract boolean

Returns:

whether this reftable can do a fast SHA1 => ref lookup.
hasObjectMap
()

Whether this reftable can do a fast SHA1 => ref lookup

public boolean

Returns:

true if the reference exists.
hasRef
(String
reference name or subtree to find.
refName
)

Test if a reference exists.

public boolean

Returns:

true if at least one reference exists with prefix.
hasRefsWithPrefix
(String
prefix to find.
prefix
)

Test if any reference starts with prefix as a prefix.

public abstract long

Returns:

the maximum update index for ref entries that appear in this reftable.
maxUpdateIndex
()

Get the maximum update index for ref entries that appear in this reftable.

public abstract long

Returns:

the minimum update index for ref entries that appear in this reftable.
minUpdateIndex
()

Get the minimum update index for ref entries that appear in this reftable.

public Ref

Returns:

resolved symref, or null.
resolve
(Ref
reference to resolve.
symref
)

Resolve a symbolic reference to populate its value.

private Ref
resolve(Ref ref, int depth)

public LogCursor

Returns:

cursor to iterate; empty cursor if no logs match.
seekLog
(String
exact name of the reference whose log to read.
refName
)

Read a single reference's log.

public abstract LogCursor

Returns:

cursor to iterate; empty cursor if no logs match.
seekLog
(String
exact name of the reference whose log to read.
refName
,
long
most recent index to return first in the log cursor. Log records at or before updateIndex will be returned.
updateIndex
)

Seek to an update index in a reference's log.

public abstract RefCursor

Returns:

cursor to iterate; empty cursor if no references match.
seekRef
(String
reference name.
refName
)

Seek to a reference.

public abstract RefCursor

Returns:

cursor to iterate; empty cursor if no references match.
seekRefsWithPrefix
(String
prefix to find.
prefix
)

Seek references with prefix.

public void
setIncludeDeletes(boolean
if true deleted references will be returned. If false (default behavior), deleted references will be skipped, and not returned.
deletes
)

Whether deleted references will be returned.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

includeDeletesback to summary
protected boolean includeDeletes

true if deletions should be included in results.

Constructor Detail

Reftableback to summary
public Reftable()

Method Detail

allLogsback to summary
public abstract LogCursor allLogs() throws IOException

Seek reader to read log records.

Returns:LogCursor

cursor to iterate; empty cursor if no logs are present.

Exceptions
IOException:
if logs cannot be read.
allRefsback to summary
public abstract RefCursor allRefs() throws IOException

Seek to the first reference, to iterate in order.

Returns:RefCursor

cursor to iterate.

Exceptions
IOException:
if references cannot be read.
byObjectIdback to summary
public abstract RefCursor byObjectId(AnyObjectId id) throws IOException

Match references pointing to a specific object.

Parameters
id:AnyObjectId

object to find.

Returns:RefCursor

cursor to iterate; empty cursor if no references match.

Exceptions
IOException:
if references cannot be read.
exactRefback to summary
public Ref exactRef(String refName) throws IOException

Lookup a reference, or null if not found.

Parameters
refName:String

reference name to find.

Returns:Ref

the reference, or null if not found.

Annotations
@Nullable
Exceptions
IOException:
if references cannot be read.
fromback to summary
public static Reftable from(Collection<Ref> refs)

References to convert into a reftable

Parameters
refs:Collection<Ref>

references to convert into a reftable; may be empty.

Returns:Reftable

a reader for the supplied references.

hasIdback to summary
public boolean hasId(AnyObjectId id) throws IOException

Test if any reference directly refers to the object.

Parameters
id:AnyObjectId

ObjectId to find.

Returns:boolean

true if any reference exists directly referencing id, or a annotated tag that peels to id.

Exceptions
IOException:
if references cannot be read.
hasObjectMapback to summary
public abstract boolean hasObjectMap() throws IOException

Whether this reftable can do a fast SHA1 => ref lookup

Returns:boolean

whether this reftable can do a fast SHA1 => ref lookup.

Exceptions
IOException:
on I/O problems.
hasRefback to summary
public boolean hasRef(String refName) throws IOException

Test if a reference exists.

Parameters
refName:String

reference name or subtree to find.

Returns:boolean

true if the reference exists.

Exceptions
IOException:
if references cannot be read.
hasRefsWithPrefixback to summary
public boolean hasRefsWithPrefix(String prefix) throws IOException

Test if any reference starts with prefix as a prefix.

Parameters
prefix:String

prefix to find.

Returns:boolean

true if at least one reference exists with prefix.

Exceptions
IOException:
if references cannot be read.
maxUpdateIndexback to summary
public abstract long maxUpdateIndex() throws IOException

Get the maximum update index for ref entries that appear in this reftable.

Returns:long

the maximum update index for ref entries that appear in this reftable.

Exceptions
IOException:
file cannot be read.
minUpdateIndexback to summary
public abstract long minUpdateIndex() throws IOException

Get the minimum update index for ref entries that appear in this reftable.

Returns:long

the minimum update index for ref entries that appear in this reftable.

Exceptions
IOException:
file cannot be read.
resolveback to summary
public Ref resolve(Ref symref) throws IOException

Resolve a symbolic reference to populate its value.

Parameters
symref:Ref

reference to resolve.

Returns:Ref

resolved symref, or null.

Annotations
@Nullable
Exceptions
IOException:
if references cannot be read.
resolveback to summary
private Ref resolve(Ref ref, int depth) throws IOException
seekLogback to summary
public LogCursor seekLog(String refName) throws IOException

Read a single reference's log.

Parameters
refName:String

exact name of the reference whose log to read.

Returns:LogCursor

cursor to iterate; empty cursor if no logs match.

Exceptions
IOException:
if logs cannot be read.
seekLogback to summary
public abstract LogCursor seekLog(String refName, long updateIndex) throws IOException

Seek to an update index in a reference's log.

Parameters
refName:String

exact name of the reference whose log to read.

updateIndex:long

most recent index to return first in the log cursor. Log records at or before updateIndex will be returned.

Returns:LogCursor

cursor to iterate; empty cursor if no logs match.

Exceptions
IOException:
if logs cannot be read.
seekRefback to summary
public abstract RefCursor seekRef(String refName) throws IOException

Seek to a reference.

This method will seek to the reference refName. If present, the returned cursor will iterate exactly one entry. If not found, an empty cursor is returned.

Parameters
refName:String

reference name.

Returns:RefCursor

cursor to iterate; empty cursor if no references match.

Exceptions
IOException:
if references cannot be read.
seekRefsWithPrefixback to summary
public abstract RefCursor seekRefsWithPrefix(String prefix) throws IOException

Seek references with prefix.

The method will seek all the references starting with prefix as a prefix. If no references start with this prefix, an empty cursor is returned.

Parameters
prefix:String

prefix to find.

Returns:RefCursor

cursor to iterate; empty cursor if no references match.

Exceptions
IOException:
if references cannot be read.
setIncludeDeletesback to summary
public void setIncludeDeletes(boolean deletes)

Whether deleted references will be returned.

Parameters
deletes:boolean

if true deleted references will be returned. If false (default behavior), deleted references will be skipped, and not returned.