Public Member Functions | Private Attributes
priodict.priorityDictionary Class Reference

List of all members.

Public Member Functions

def __init__
def __iter__
def __setitem__
def setdefault
def smallest

Private Attributes

 __heap

Detailed Description

Definition at line 7 of file priodict.py.


Constructor & Destructor Documentation

Initialize priorityDictionary by creating binary heap
of pairs (value,key).  Note that changing or removing a dict entry will
not remove the old pair from the heap until it is found by smallest() or
until the heap is rebuilt.

Definition at line 8 of file priodict.py.


Member Function Documentation

Create destructive sorted iterator of priorityDictionary.

Definition at line 36 of file priodict.py.

def priodict.priorityDictionary.__setitem__ (   self,
  key,
  val 
)
Change value stored in dictionary and add corresponding
pair to heap.  Rebuilds the heap if the number of deleted items grows
too large, to avoid memory leakage.

Definition at line 45 of file priodict.py.

def priodict.priorityDictionary.setdefault (   self,
  key,
  val 
)
Reimplement setdefault to call our customized __setitem__.

Definition at line 64 of file priodict.py.

Find smallest item after removing deleted items from heap.

Definition at line 16 of file priodict.py.


Member Data Documentation

Definition at line 11 of file priodict.py.


The documentation for this class was generated from the following file:


k-sap_pkg
Author(s): Joao Manuel Leitao Quintas
autogenerated on Mon Jan 6 2014 11:25:40