List of utility methods to do BitSet
String | toString(BitSet bs) to String int len = bs.length(); StringBuffer buf = new StringBuffer(len); for (int i = 0; i < len; i++) buf.append(bs.get(i) ? '1' : '0'); return buf.toString(); |
List | translateBitSetToProjIndx(BitSet projBitSet) translate Bit Set To Proj Indx List<Integer> projIndxLst = new ArrayList<Integer>(); for (int i = 0; i < projBitSet.length(); i++) { if (projBitSet.get(i)) { projIndxLst.add(i); return projIndxLst; |
void | unionAdd(BitSet newClique, int nNodes, LinkedList union Add for (int iClique = cliques.size(); iClique-- != 0;) { if (iClique >= cliques.size()) continue; BitSet clique = cliques.get(iClique); boolean containsAll = true, isAllContained = true; for (int node = nNodes; node-- != 0;) { boolean bClique = clique.get(node), bNew = newClique.get(node); if (bClique) { ... |
int | unpackInt(BitSet bs, int offset, int noOfBits) Unpack an integer value from a bit set. int val = 0; for (int i = 0; i < noOfBits; i++) { if (bs.get(offset + i)) val |= 1 << (noOfBits - i - 1); return val; |
BitSet | unsignedIntToLittleEndianBitSet(int i) unsigned Int To Little Endian Bit Set BitSet bs = new BitSet(32); for (int j = 0; j < 32; ++j) { if ((i & 1) == 1) { bs.set(j); i >>>= 1; return bs; ... |
boolean | validateEncoded(BitSet encoded, int encodedBitLength) validate Encoded int errorSyndromeLength = (int) (Math.log(encodedBitLength) / Math.log(2)) + 1; BitSet errorSyndrome = new BitSet(errorSyndromeLength); for (int bitmask = 1, j = 0; j < errorSyndromeLength; bitmask <<= 1, ++j) { int countOfBits = 0; for (int i = bitmask; i <= encodedBitLength; ++i) { if ((i & bitmask) != 0) { countOfBits += (encoded.get(encodedBitLength - i) ? 1 : 0); countOfBits %= 2; errorSyndrome.set(j, countOfBits != 0); return errorSyndrome.length() == 0; |
BitSet | validCookieNameOctets(BitSet validCookieValueOctets) valid Cookie Name Octets BitSet bits = new BitSet(8); bits.or(validCookieValueOctets); bits.set('(', false); bits.set(')', false); bits.set('<', false); bits.set('>', false); bits.set('@', false); bits.set(':', false); ... |