Class DfsRefDatabase.RefCache
java.lang.Object
org.eclipse.jgit.internal.storage.dfs.DfsRefDatabase.RefCache
- Enclosing class:
DfsRefDatabase
Collection of references managed by this database.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFind a reference by name.Obtain a modified copy of the cache with a ref stored.Obtain a modified copy of the cache with the ref removed.int
size()
-
Field Details
-
ids
-
sym
-
-
Constructor Details
-
RefCache
Initialize a new reference cache.The two reference lists supplied must be sorted in correct order (string compare order) by name.
- Parameters:
ids
- references that carry an ObjectId, and all ofsym
.sym
- references that are symbolic references to others.
-
RefCache
RefCache(RefList<Ref> ids, DfsRefDatabase.RefCache old)
-
-
Method Details
-
size
public int size()- Returns:
- number of references in this cache.
-
get
Find a reference by name.- Parameters:
name
- full name of the reference.- Returns:
- the reference, if it exists, otherwise null.
-
put
Obtain a modified copy of the cache with a ref stored.This cache instance is not modified by this method.
- Parameters:
ref
- reference to add or replace.- Returns:
- a copy of this cache, with the reference added or replaced.
-
remove
Obtain a modified copy of the cache with the ref removed.This cache instance is not modified by this method.
- Parameters:
refName
- reference to remove, if it exists.- Returns:
- a copy of this cache, with the reference removed.
-