return bitmapIndex;
}
+ @Override
+ public EWAHCompressedBitmap retrieveCompressed() {
+ return build().retrieveCompressed();
+ }
+
private EWAHCompressedBitmap ewahBitmap(Bitmap other) {
if (other instanceof CompressedBitmap) {
CompressedBitmap b = (CompressedBitmap) other;
};
}
- EWAHCompressedBitmap getEwahCompressedBitmap() {
+ @Override
+ public EWAHCompressedBitmap retrieveCompressed() {
return bitmap;
}
import java.util.NoSuchElementException;
import org.eclipse.jgit.internal.JGitText;
-import org.eclipse.jgit.internal.storage.file.BitmapIndexImpl.CompressedBitmap;
import org.eclipse.jgit.internal.storage.pack.ObjectToPack;
import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.BitmapIndex.Bitmap;
-import org.eclipse.jgit.lib.BitmapIndex.BitmapBuilder;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectIdOwnerMap;
* the flags to be stored with the bitmap
*/
public void addBitmap(AnyObjectId objectId, Bitmap bitmap, int flags) {
- if (bitmap instanceof BitmapBuilder)
- bitmap = ((BitmapBuilder) bitmap).build();
-
- EWAHCompressedBitmap compressed;
- if (bitmap instanceof CompressedBitmap)
- compressed = ((CompressedBitmap) bitmap).getEwahCompressedBitmap();
- else
- throw new IllegalArgumentException(bitmap.getClass().toString());
-
- addBitmap(objectId, compressed, flags);
+ addBitmap(objectId, bitmap.retrieveCompressed(), flags);
}
/**
import org.eclipse.jgit.internal.storage.file.PackBitmapIndex;
+import com.googlecode.javaewah.EWAHCompressedBitmap;
+
/**
* A compressed bitmap representation of the entire object graph.
*
*/
@Override
Iterator<BitmapObject> iterator();
+
+ /**
+ * Returns the corresponding raw compressed EWAH bitmap of the bitmap.
+ *
+ * @return the corresponding {@code EWAHCompressedBitmap}
+ * @since 5.8
+ */
+ EWAHCompressedBitmap retrieveCompressed();
}
/**