public class PackBitmapIndexRemapper extends PackBitmapIndex implements java.lang.Iterable<PackBitmapIndexRemapper.Entry>
Modifier and Type | Class and Description |
---|---|
static class |
PackBitmapIndexRemapper.Entry
An entry in the old PackBitmapIndex.
|
Modifier and Type | Field and Description |
---|---|
private ObjectIdOwnerMap<BasePackBitmapIndex.StoredBitmap> |
convertedBitmaps |
private BitSet |
inflated |
(package private) PackBitmapIndex |
newPackIndex |
private BasePackBitmapIndex |
oldPackIndex |
private int[] |
prevToNewMapping |
FLAG_REUSE, packChecksum
Modifier | Constructor and Description |
---|---|
private |
PackBitmapIndexRemapper(BasePackBitmapIndex oldPackIndex,
PackBitmapIndex newPackIndex) |
private |
PackBitmapIndexRemapper(PackBitmapIndex newPackIndex) |
Modifier and Type | Method and Description |
---|---|
int |
findPosition(AnyObjectId objectId)
Finds the position in the bitmap of the object.
|
com.googlecode.javaewah.EWAHCompressedBitmap |
getBitmap(AnyObjectId objectId)
Returns the previously constructed bitmap for the object.
|
int |
getBitmapCount()
Returns the number of bitmaps in this bitmap index.
|
ObjectId |
getObject(int position)
Get the object at the bitmap position.
|
int |
getObjectCount()
Obtain the total number of objects described by this index.
|
java.util.Iterator<PackBitmapIndexRemapper.Entry> |
iterator() |
static PackBitmapIndexRemapper |
newPackBitmapIndex(BitmapIndex prevBitmapIndex,
PackBitmapIndex newIndex)
A PackBitmapIndex that maps the positions in the prevBitmapIndex to the
ones in the newIndex.
|
com.googlecode.javaewah.EWAHCompressedBitmap |
ofObjectType(com.googlecode.javaewah.EWAHCompressedBitmap bitmap,
int type)
Returns a bitmap containing positions for objects that have the given Git
type.
|
open, read
private final BasePackBitmapIndex oldPackIndex
final PackBitmapIndex newPackIndex
private final ObjectIdOwnerMap<BasePackBitmapIndex.StoredBitmap> convertedBitmaps
private final BitSet inflated
private final int[] prevToNewMapping
private PackBitmapIndexRemapper(PackBitmapIndex newPackIndex)
private PackBitmapIndexRemapper(BasePackBitmapIndex oldPackIndex, PackBitmapIndex newPackIndex)
public static PackBitmapIndexRemapper newPackBitmapIndex(BitmapIndex prevBitmapIndex, PackBitmapIndex newIndex)
prevBitmapIndex
- the bitmap index with the old mapping.newIndex
- the bitmap index with the new mapping.public int findPosition(AnyObjectId objectId)
findPosition
in class PackBitmapIndex
objectId
- the id for which the bitmap position will be found.public ObjectId getObject(int position) throws java.lang.IllegalArgumentException
getObject
in class PackBitmapIndex
position
- the id for which the object will be found.java.lang.IllegalArgumentException
- when the item is not found.public int getObjectCount()
getObjectCount() - 1
is the largest bit that will be set in a
bitmap.getObjectCount
in class PackBitmapIndex
public com.googlecode.javaewah.EWAHCompressedBitmap ofObjectType(com.googlecode.javaewah.EWAHCompressedBitmap bitmap, int type)
ofObjectType
in class PackBitmapIndex
bitmap
- the object bitmap.type
- the Git type.public java.util.Iterator<PackBitmapIndexRemapper.Entry> iterator()
iterator
in interface java.lang.Iterable<PackBitmapIndexRemapper.Entry>
public com.googlecode.javaewah.EWAHCompressedBitmap getBitmap(AnyObjectId objectId)
getBitmap
in class PackBitmapIndex
objectId
- the id for which the bitmap will be found.public int getBitmapCount()
getBitmapCount
in class PackBitmapIndex