Package schrodinger :: Package application :: Package combiglide :: Package packages :: Module chutils :: Class BitArray
[hide private]
[frames] | no frames]

Class BitArray

Minimal bit-array class

Instance Methods [hide private]
 
__init__(self, bit_len=None, blob=None)
If blob is specified, create a bit-array from it, assuming it is an sqlite blob containing packed Longs constituting a bit array.
 
clear(self)
Unset all bits
 
unset(self, jbit)
Unset a specified bit
 
set(self, jbit)
Set a specified bit
 
get(self, jbit)
Return the value of a specified bit
 
getList(self)
Return a Py list of the bits that are set
 
blobify(self)
Return a blob of the bit array suitable for inserting into sqlite
 
deblobify(self, blob)
Unpack an sqlite blob into a bit array
 
__and__(self, other)
 
__eq__(self, other)
 
__nonzero__(self)
Class Variables [hide private]
  ar_type = 'I'
  bits_per_word = 8* array.array(ar_type).itemsize
  bit = []
Method Details [hide private]

__init__(self, bit_len=None, blob=None)
(Constructor)

 

If blob is specified, create a bit-array from it, assuming it is an sqlite blob containing packed Longs constituting a bit array. Else, if bit_len is specified, return an empty bit set large enough to hold the specified number of bits. An exception is thrown if neither neither bit_len nor blob is specified.