Package org.apache.iotdb.tsfile.utils
Class BitMap
- java.lang.Object
-
- org.apache.iotdb.tsfile.utils.BitMap
-
public class BitMap extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BitMapclone()static voidcopyOfRange(BitMap src, int srcPos, BitMap dest, int destPos, int length)Copies a bitmap from the specified source bitmap, beginning at the specified position, to the specified position of the destination bitmap.booleanequals(java.lang.Object obj)byte[]getByteArray()BitMapgetRegion(int positionOffset, int length)intgetSize()inthashCode()booleanisAllMarked()whether all bits are one, i.e., all are NullbooleanisAllUnmarked()whether all bits are zero, i.e., no Null valuebooleanisMarked(int position)returns the value of the bit with the specified index.voidmark(int position)mark as 1 at the given bit position.voidmarkAll()mark as 1 at all positions.voidreset()mark as 0 at all positions.java.lang.StringtoString()voidunmark(int position)
-
-
-
Method Detail
-
getByteArray
public byte[] getByteArray()
-
getSize
public int getSize()
-
isMarked
public boolean isMarked(int position)
returns the value of the bit with the specified index.
-
markAll
public void markAll()
mark as 1 at all positions.
-
mark
public void mark(int position)
mark as 1 at the given bit position.
-
reset
public void reset()
mark as 0 at all positions.
-
unmark
public void unmark(int position)
-
isAllUnmarked
public boolean isAllUnmarked()
whether all bits are zero, i.e., no Null value
-
isAllMarked
public boolean isAllMarked()
whether all bits are one, i.e., all are Null
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
clone
public BitMap clone()
- Overrides:
clonein classjava.lang.Object
-
copyOfRange
public static void copyOfRange(BitMap src, int srcPos, BitMap dest, int destPos, int length)
Copies a bitmap from the specified source bitmap, beginning at the specified position, to the specified position of the destination bitmap. A subsequence of bits are copied from the source bitmap referenced by src to the destination bitmap referenced by dest. The number of bits copied is equal to the length argument. The bits at positions srcPos through srcPos+length-1 in the source bitmap are copied into positions destPos through destPos+length-1, respectively, of the destination bitmap.- Parameters:
src- the source bitmap.srcPos- starting position in the source bitmap.dest- the destination bitmap.destPos- starting position in the destination bitmap.length- the number of bits to be copied.- Throws:
java.lang.IndexOutOfBoundsException- if copying would cause access of data outside bitmap bounds.
-
getRegion
public BitMap getRegion(int positionOffset, int length)
-
-