java.lang.Object | |
↳ | org.apache.lucene.util.BitUtil |
A variety of high efficiency bit twiddling routines.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ntzTable | table of number of trailing zeros in a byte |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
returns true if v is a power of two or zero
| |||||||||||
returns true if v is a power of two or zero
| |||||||||||
returns the next highest power of two, or the current value if it's already a power of two or zero
| |||||||||||
returns the next highest power of two, or the current value if it's already a power of two or zero
| |||||||||||
Returns number of trailing zeros in a 64 bit long value.
| |||||||||||
Returns number of trailing zeros in a 32 bit int value.
| |||||||||||
returns 0 based index of first set bit
(only works for x!=0)
This is an alternate implementation of ntz() | |||||||||||
returns 0 based index of first set bit
This is an alternate implementation of ntz() | |||||||||||
Returns the number of bits set in the long
| |||||||||||
Returns the popcount or cardinality of A & ~B
Neither array is modified.
| |||||||||||
Returns the number of set bits in an array of longs.
| |||||||||||
Returns the popcount or cardinality of the two sets after an intersection.
| |||||||||||
Returns the popcount or cardinality of the union of two sets.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
table of number of trailing zeros in a byte
returns true if v is a power of two or zero
returns true if v is a power of two or zero
returns the next highest power of two, or the current value if it's already a power of two or zero
returns the next highest power of two, or the current value if it's already a power of two or zero
Returns number of trailing zeros in a 64 bit long value.
Returns number of trailing zeros in a 32 bit int value.
returns 0 based index of first set bit
(only works for x!=0)
This is an alternate implementation of ntz()
returns 0 based index of first set bit
This is an alternate implementation of ntz()
Returns the number of bits set in the long
Returns the popcount or cardinality of A & ~B Neither array is modified.
Returns the number of set bits in an array of longs.
Returns the popcount or cardinality of the two sets after an intersection. Neither array is modified.
Returns the popcount or cardinality of the union of two sets. Neither array is modified.