Class PackBitmapIndexV1
- java.lang.Object
-
- org.eclipse.jgit.internal.storage.file.PackBitmapIndex
-
- org.eclipse.jgit.internal.storage.file.BasePackBitmapIndex
-
- org.eclipse.jgit.internal.storage.file.PackBitmapIndexV1
-
class PackBitmapIndexV1 extends BasePackBitmapIndex
Support for the pack bitmap index v1 format.- See Also:
PackBitmapIndex
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jgit.internal.storage.file.BasePackBitmapIndex
BasePackBitmapIndex.StoredBitmap
-
-
Field Summary
Fields Modifier and Type Field Description private ObjectIdOwnerMap<BasePackBitmapIndex.StoredBitmap>bitmapsprivate com.googlecode.javaewah.EWAHCompressedBitmapblobsprivate com.googlecode.javaewah.EWAHCompressedBitmapcommits(package private) static byte[]MAGICprivate static intMAX_XOR_OFFSET(package private) static intOPT_FULLprivate PackIndexpackIndexprivate PackReverseIndexreverseIndexprivate com.googlecode.javaewah.EWAHCompressedBitmaptagsprivate com.googlecode.javaewah.EWAHCompressedBitmaptrees-
Fields inherited from class org.eclipse.jgit.internal.storage.file.PackBitmapIndex
FLAG_REUSE, packChecksum
-
-
Constructor Summary
Constructors Constructor Description PackBitmapIndexV1(java.io.InputStream fd, PackIndex packIndex, PackReverseIndex reverseIndex)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)intfindPosition(AnyObjectId objectId)Finds the position in the bitmap of the object.intgetBitmapCount()Returns the number of bitmaps in this bitmap index.ObjectIdgetObject(int position)Get the object at the bitmap position.intgetObjectCount()Obtain the total number of objects described by this index.(package private) PackIndexgetPackIndex()inthashCode()com.googlecode.javaewah.EWAHCompressedBitmapofObjectType(com.googlecode.javaewah.EWAHCompressedBitmap bitmap, int type)Returns a bitmap containing positions for objects that have the given Git type.private static com.googlecode.javaewah.EWAHCompressedBitmapreadBitmap(java.io.DataInput dataInput)-
Methods inherited from class org.eclipse.jgit.internal.storage.file.BasePackBitmapIndex
getBitmap, getBitmaps
-
Methods inherited from class org.eclipse.jgit.internal.storage.file.PackBitmapIndex
open, read
-
-
-
-
Field Detail
-
MAGIC
static final byte[] MAGIC
-
OPT_FULL
static final int OPT_FULL
- See Also:
- Constant Field Values
-
MAX_XOR_OFFSET
private static final int MAX_XOR_OFFSET
- See Also:
- Constant Field Values
-
packIndex
private final PackIndex packIndex
-
reverseIndex
private final PackReverseIndex reverseIndex
-
commits
private final com.googlecode.javaewah.EWAHCompressedBitmap commits
-
trees
private final com.googlecode.javaewah.EWAHCompressedBitmap trees
-
blobs
private final com.googlecode.javaewah.EWAHCompressedBitmap blobs
-
tags
private final com.googlecode.javaewah.EWAHCompressedBitmap tags
-
bitmaps
private final ObjectIdOwnerMap<BasePackBitmapIndex.StoredBitmap> bitmaps
-
-
Constructor Detail
-
PackBitmapIndexV1
PackBitmapIndexV1(java.io.InputStream fd, PackIndex packIndex, PackReverseIndex reverseIndex) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
findPosition
public int findPosition(AnyObjectId objectId)
Finds the position in the bitmap of the object.- Specified by:
findPositionin classPackBitmapIndex- Parameters:
objectId- the id for which the bitmap position will be found.- Returns:
- the bitmap id or -1 if the object was not found.
-
getObject
public ObjectId getObject(int position) throws java.lang.IllegalArgumentException
Get the object at the bitmap position.- Specified by:
getObjectin classPackBitmapIndex- Parameters:
position- the id for which the object will be found.- Returns:
- the ObjectId.
- Throws:
java.lang.IllegalArgumentException- when the item is not found.
-
getObjectCount
public int getObjectCount()
Obtain the total number of objects described by this index.getObjectCount() - 1is the largest bit that will be set in a bitmap.- Specified by:
getObjectCountin classPackBitmapIndex- Returns:
- number of objects in this index, and likewise in the associated pack that this index was generated from.
-
ofObjectType
public 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.- Specified by:
ofObjectTypein classPackBitmapIndex- Parameters:
bitmap- the object bitmap.type- the Git type.- Returns:
- the object bitmap with only objects of the Git type.
-
getBitmapCount
public int getBitmapCount()
Returns the number of bitmaps in this bitmap index.- Specified by:
getBitmapCountin classPackBitmapIndex- Returns:
- the number of bitmaps in this bitmap index.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getPackIndex
PackIndex getPackIndex()
-
readBitmap
private static com.googlecode.javaewah.EWAHCompressedBitmap readBitmap(java.io.DataInput dataInput) throws java.io.IOException- Throws:
java.io.IOException
-
-