Package recsql :: Module sqlarray :: Class KRingbuffer
[hide private]
[frames] | no frames]

Class KRingbuffer

source code

object --+    
         |    
      dict --+
             |
            KRingbuffer

Ring buffer with key lookup.

Basically a ringbuffer for the keys and a dict (k,v) that is cleaned up to reflect the keys in the Ringbuffer.

Instance Methods [hide private]
new empty dictionary

__init__(self, capacity, *args, **kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
append(x, k, v) source code
None
clear(self)
Reinitialize the KRingbuffer to empty.
source code
 
_prune(self)
Primitive way to keep dict in sync with RB.
source code
 
__setitem__(self, k, v)
x[i]=y
source code
 
__delitem__(self, k)
del x[y]
source code
None
update(self, *args, **kwargs)
Update D from E and F: for k in E: D[k] = E[k] (if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k]
source code

Inherited from dict: __cmp__, __contains__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __hash__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, values

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, capacity, *args, **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Returns:
new empty dictionary

Overrides: object.__init__
(inherited documentation)

clear(self)

source code 

Reinitialize the KRingbuffer to empty.

Returns: None
Overrides: dict.clear

__setitem__(self, k, v)
(Index assignment operator)

source code 

x[i]=y

Overrides: dict.__setitem__
(inherited documentation)

__delitem__(self, k)
(Index deletion operator)

source code 

del x[y]

Overrides: dict.__delitem__
(inherited documentation)

update(self, *args, **kwargs)

source code 

Update D from E and F: for k in E: D[k] = E[k] (if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k]

Returns: None
Overrides: dict.update
(inherited documentation)