Class PackBitmapIndexV1


class PackBitmapIndexV1 extends BasePackBitmapIndex
Support for the pack bitmap index v1 format.
See Also:
  • Field Details

    • MAGIC

      static final byte[] MAGIC
    • OPT_FULL

      static final int OPT_FULL
      See Also:
    • MAX_XOR_OFFSET

      private static final int MAX_XOR_OFFSET
      See Also:
    • 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

  • Constructor Details

  • Method Details

    • findPosition

      public int findPosition(AnyObjectId objectId)
      Finds the position in the bitmap of the object.
      Specified by:
      findPosition in class PackBitmapIndex
      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 IllegalArgumentException
      Get the object at the bitmap position.
      Specified by:
      getObject in class PackBitmapIndex
      Parameters:
      position - the id for which the object will be found.
      Returns:
      the ObjectId.
      Throws:
      IllegalArgumentException - when the item is not found.
    • getObjectCount

      public int getObjectCount()
      Obtain the total number of objects described by this index. getObjectCount() - 1 is the largest bit that will be set in a bitmap.
      Specified by:
      getObjectCount in class PackBitmapIndex
      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:
      ofObjectType in class PackBitmapIndex
      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:
      getBitmapCount in class PackBitmapIndex
      Returns:
      the number of bitmaps in this bitmap index.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getPackIndex

      PackIndex getPackIndex()
    • readBitmap

      private static com.googlecode.javaewah.EWAHCompressedBitmap readBitmap(DataInput dataInput) throws IOException
      Throws:
      IOException