public class BitSetUtil extends Object
| 构造器和说明 |
|---|
BitSetUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static BitSet |
copy(BitSet b) |
static BitSet |
fromArray(boolean[] array)
Converts an array of
boolean into a BitSet. |
static BitSet |
fromList(List<Boolean> list)
|
static BitSet |
getRandomBits(int n,
Random random) |
static boolean |
innerProduct(BitSet a,
BitSet b)
Returns the inner product of the two
BitSet, e.g. |
static boolean[] |
toArray(BitSet bitset,
int length)
Converts of a
BitSet to an array of boolean. |
static List<Boolean> |
toList(BitSet bitset,
int n)
|
static String |
toString(BitSet bits)
Return a string representation of all the given BitSet until (and including)
the highest set bit.
|
static String |
toString(BitSet bits,
int n) |
public static String toString(BitSet bits)
bits - a BitSetbitspublic static boolean innerProduct(BitSet a, BitSet b)
BitSet, e.g.
a0b0 ⊕ ... ⊕
an-1bn-1.a - left operandb - right operanda and bpublic static BitSet fromList(List<Boolean> list)
list - a list of Booleanslistpublic static BitSet fromArray(boolean[] array)
boolean into a BitSet.array - an array of booleansarraypublic static boolean[] toArray(BitSet bitset, int length)
BitSet to an array of boolean.bitset - a BitSetlength - the number of bits of bitset to convert to arraylength first bits of
bitsetCopyright © 2019. All Rights Reserved.