Class BitmapIndexImpl.CompressedBitmapBuilder
- java.lang.Object
-
- org.eclipse.jgit.internal.storage.file.BitmapIndexImpl.CompressedBitmapBuilder
-
- All Implemented Interfaces:
java.lang.Iterable<BitmapObject>
,BitmapIndex.Bitmap
,BitmapIndex.BitmapBuilder
- Enclosing class:
- BitmapIndexImpl
private static final class BitmapIndexImpl.CompressedBitmapBuilder extends java.lang.Object implements BitmapIndex.BitmapBuilder
-
-
Field Summary
Fields Modifier and Type Field Description private BitmapIndexImpl
bitmapIndex
private BitmapIndexImpl.ComboBitset
bitset
-
Constructor Summary
Constructors Constructor Description CompressedBitmapBuilder(BitmapIndexImpl bitmapIndex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BitmapIndex.BitmapBuilder
addObject(AnyObjectId objectId, int type)
Adds the id to the bitmap.BitmapIndexImpl.CompressedBitmapBuilder
andNot(BitmapIndex.Bitmap other)
Bitwise-AND-NOT the current bitmap with the value from the other bitmap.BitmapIndexImpl.CompressedBitmap
build()
int
cardinality()
boolean
contains(AnyObjectId objectId)
Whether the bitmap has the id set.private com.googlecode.javaewah.EWAHCompressedBitmap
ewahBitmap(BitmapIndex.Bitmap other)
BitmapIndexImpl
getBitmapIndex()
Get the BitmapIndex for this BitmapBuilder.java.util.Iterator<BitmapObject>
iterator()
Returns an iterator over a set of elements of type BitmapObject.BitmapIndexImpl.CompressedBitmapBuilder
or(BitmapIndex.Bitmap other)
Bitwise-OR the current bitmap with the value from the other bitmap.void
remove(AnyObjectId objectId)
Remove the id from the bitmap.boolean
removeAllOrNone(PackBitmapIndex index)
Determines if the entire bitmap index is contained in the bitmap.com.googlecode.javaewah.EWAHCompressedBitmap
retrieveCompressed()
Returns the corresponding raw compressed EWAH bitmap of the bitmap.BitmapIndexImpl.CompressedBitmapBuilder
xor(BitmapIndex.Bitmap other)
Bitwise-XOR the current bitmap with the value from the other bitmap.
-
-
-
Field Detail
-
bitset
private BitmapIndexImpl.ComboBitset bitset
-
bitmapIndex
private final BitmapIndexImpl bitmapIndex
-
-
Constructor Detail
-
CompressedBitmapBuilder
CompressedBitmapBuilder(BitmapIndexImpl bitmapIndex)
-
-
Method Detail
-
contains
public boolean contains(AnyObjectId objectId)
Description copied from interface:BitmapIndex.BitmapBuilder
Whether the bitmap has the id set.- Specified by:
contains
in interfaceBitmapIndex.BitmapBuilder
- Parameters:
objectId
- the object ID- Returns:
- whether the bitmap currently contains the object ID
-
addObject
public BitmapIndex.BitmapBuilder addObject(AnyObjectId objectId, int type)
Description copied from interface:BitmapIndex.BitmapBuilder
Adds the id to the bitmap.- Specified by:
addObject
in interfaceBitmapIndex.BitmapBuilder
- Parameters:
objectId
- the object IDtype
- the Git object type. SeeConstants
.- Returns:
- the current builder.
-
remove
public void remove(AnyObjectId objectId)
Description copied from interface:BitmapIndex.BitmapBuilder
Remove the id from the bitmap.- Specified by:
remove
in interfaceBitmapIndex.BitmapBuilder
- Parameters:
objectId
- the object ID
-
or
public BitmapIndexImpl.CompressedBitmapBuilder or(BitmapIndex.Bitmap other)
Description copied from interface:BitmapIndex.BitmapBuilder
Bitwise-OR the current bitmap with the value from the other bitmap.- Specified by:
or
in interfaceBitmapIndex.Bitmap
- Specified by:
or
in interfaceBitmapIndex.BitmapBuilder
- Parameters:
other
- the other bitmap- Returns:
- the current builder.
-
andNot
public BitmapIndexImpl.CompressedBitmapBuilder andNot(BitmapIndex.Bitmap other)
Description copied from interface:BitmapIndex.BitmapBuilder
Bitwise-AND-NOT the current bitmap with the value from the other bitmap.- Specified by:
andNot
in interfaceBitmapIndex.Bitmap
- Specified by:
andNot
in interfaceBitmapIndex.BitmapBuilder
- Parameters:
other
- the other bitmap- Returns:
- the current builder.
-
xor
public BitmapIndexImpl.CompressedBitmapBuilder xor(BitmapIndex.Bitmap other)
Description copied from interface:BitmapIndex.BitmapBuilder
Bitwise-XOR the current bitmap with the value from the other bitmap.- Specified by:
xor
in interfaceBitmapIndex.Bitmap
- Specified by:
xor
in interfaceBitmapIndex.BitmapBuilder
- Parameters:
other
- the other bitmap- Returns:
- the current builder.
-
build
public BitmapIndexImpl.CompressedBitmap build()
- Specified by:
build
in interfaceBitmapIndex.BitmapBuilder
- Returns:
- the fully built immutable bitmap
-
iterator
public java.util.Iterator<BitmapObject> iterator()
Description copied from interface:BitmapIndex.Bitmap
Returns an iterator over a set of elements of type BitmapObject. The BitmapObject instance is reused across calls toIterator.next()
for performance reasons.- Specified by:
iterator
in interfaceBitmapIndex.Bitmap
- Specified by:
iterator
in interfacejava.lang.Iterable<BitmapObject>
- Returns:
- an Iterator.
-
cardinality
public int cardinality()
- Specified by:
cardinality
in interfaceBitmapIndex.BitmapBuilder
- Returns:
- the number of elements in the bitmap.
-
removeAllOrNone
public boolean removeAllOrNone(PackBitmapIndex index)
Description copied from interface:BitmapIndex.BitmapBuilder
Determines if the entire bitmap index is contained in the bitmap. If it is, the matching bits are removed from the bitmap and true is returned. If the bitmap index is null, false is returned.- Specified by:
removeAllOrNone
in interfaceBitmapIndex.BitmapBuilder
- Parameters:
index
- the bitmap index to check if it is completely contained inside of the current bitmap.- Returns:
true
if the bitmap index was a complete match.
-
getBitmapIndex
public BitmapIndexImpl getBitmapIndex()
Description copied from interface:BitmapIndex.BitmapBuilder
Get the BitmapIndex for this BitmapBuilder.- Specified by:
getBitmapIndex
in interfaceBitmapIndex.BitmapBuilder
- Returns:
- the BitmapIndex for this BitmapBuilder
-
retrieveCompressed
public com.googlecode.javaewah.EWAHCompressedBitmap retrieveCompressed()
Description copied from interface:BitmapIndex.Bitmap
Returns the corresponding raw compressed EWAH bitmap of the bitmap.- Specified by:
retrieveCompressed
in interfaceBitmapIndex.Bitmap
- Returns:
- the corresponding
EWAHCompressedBitmap
-
ewahBitmap
private com.googlecode.javaewah.EWAHCompressedBitmap ewahBitmap(BitmapIndex.Bitmap other)
-
-