public final class OffsetBitVector extends BitVectorBase<OffsetBitVector>
bits, BITS_PER_UNIT, DEBUG, LOG_BITS_PER_UNIT, LOW_MASK, MASK
Constructor and Description |
---|
OffsetBitVector() |
OffsetBitVector(int offset,
int nbits)
Creates an empty string with the specified size.
|
OffsetBitVector(OffsetBitVector s)
Creates a copy of a Bit String
|
Modifier and Type | Method and Description |
---|---|
void |
and(OffsetBitVector set)
Logically ANDs this bit set with the specified set of bits.
|
static OffsetBitVector |
and(OffsetBitVector b1,
OffsetBitVector b2)
Return a new bit string as the AND of two others.
|
void |
andNot(OffsetBitVector set) |
static OffsetBitVector |
andNot(OffsetBitVector b1,
OffsetBitVector b2)
Return a new bit string as the AND of two others.
|
void |
clear(int bit)
Clears a bit.
|
void |
copyBits(OffsetBitVector set)
Copies the values of the bits in the specified set into this set.
|
boolean |
equals(Object obj)
Compares this object against the specified object.
|
boolean |
get(int bit)
Gets a bit.
|
int |
getOffset() |
boolean |
intersectionEmpty(OffsetBitVector set)
Check if the intersection of the two sets is empty
|
boolean |
isSubset(OffsetBitVector other) |
int |
length()
Calculates and returns the set's size in bits.
|
int |
max() |
int |
nextSetBit(int start) |
void |
not()
Logically NOT this bit string
|
static OffsetBitVector |
not(OffsetBitVector s)
Return the NOT of a bit string
|
void |
or(OffsetBitVector set)
Logically ORs this bit set with the specified set of bits.
|
static OffsetBitVector |
or(OffsetBitVector b1,
OffsetBitVector b2)
Return a new FixedSizeBitVector as the OR of two others
|
boolean |
sameBits(OffsetBitVector set)
Compares this object against the specified object.
|
void |
set(int bit)
Sets a bit.
|
void |
setAll()
Sets all bits.
|
String |
toString() |
void |
xor(OffsetBitVector set)
Logically XORs this bit set with the specified set of bits.
|
clearAll, clone, contains, copyBits, hashCode, isZero, populationCount, subscript
public OffsetBitVector()
public OffsetBitVector(int offset, int nbits)
nbits
- the size of the stringpublic OffsetBitVector(OffsetBitVector s)
s
- the string to copyIllegalArgumentException
- if s is nullpublic String toString()
toString
in class BitVectorBase<OffsetBitVector>
public int getOffset()
public final void set(int bit)
set
in class BitVectorBase<OffsetBitVector>
bit
- the bit to be setpublic final void clear(int bit)
clear
in class BitVectorBase<OffsetBitVector>
bit
- the bit to be clearedpublic final boolean get(int bit)
get
in class BitVectorBase<OffsetBitVector>
bit
- the bit to be gottenpublic int nextSetBit(int start)
nextSetBit
in class BitVectorBase<OffsetBitVector>
start
- public final void not()
public int max()
max
in class BitVectorBase<OffsetBitVector>
public final int length()
length
in class BitVectorBase<OffsetBitVector>
public final void setAll()
public boolean equals(Object obj)
public final boolean intersectionEmpty(OffsetBitVector set) throws IllegalArgumentException
intersectionEmpty
in class BitVectorBase<OffsetBitVector>
set
- the set to check intersection withIllegalArgumentException
- if set == nullpublic final boolean sameBits(OffsetBitVector set) throws IllegalArgumentException
sameBits
in class BitVectorBase<OffsetBitVector>
set
- the object to compare withIllegalArgumentException
- if set == nullpublic boolean isSubset(OffsetBitVector other) throws IllegalArgumentException
isSubset
in class BitVectorBase<OffsetBitVector>
IllegalArgumentException
public final void copyBits(OffsetBitVector set)
set
- the bit set to copy the bits fromIllegalArgumentException
- if set is nullpublic final void and(OffsetBitVector set) throws IllegalArgumentException
and
in class BitVectorBase<OffsetBitVector>
set
- the bit set to be ANDed withIllegalArgumentException
- if set == nullpublic final void or(OffsetBitVector set) throws IllegalArgumentException
or
in class BitVectorBase<OffsetBitVector>
set
- the bit set to be ORed withIllegalArgumentException
- if set == nullpublic final void xor(OffsetBitVector set) throws IllegalArgumentException
xor
in class BitVectorBase<OffsetBitVector>
set
- the bit set to be XORed withIllegalArgumentException
- if set == nullpublic void andNot(OffsetBitVector set) throws IllegalArgumentException
andNot
in class BitVectorBase<OffsetBitVector>
IllegalArgumentException
public static OffsetBitVector not(OffsetBitVector s)
public static OffsetBitVector and(OffsetBitVector b1, OffsetBitVector b2) throws IllegalArgumentException
IllegalArgumentException
- if b2 == nullpublic static OffsetBitVector or(OffsetBitVector b1, OffsetBitVector b2) throws IllegalArgumentException
IllegalArgumentException
- if b2 == nullpublic static OffsetBitVector andNot(OffsetBitVector b1, OffsetBitVector b2)