Package schrodinger :: Package job :: Module queue :: Class LinkedList
[hide private]
[frames] | no frames]

Class LinkedList

A doubly linked list, providing constant time addition, size, and truth checks. It provides for constant time removal if you have the node object in hand. It provides for linear time iteration without copying while allowing removals or additions to the list during iteration.

Instance Methods [hide private]
 
__init__(self)
 
__nonzero__(self)
 
__len__(self)
 
_iter_from(self, start, reverse=False)
Iterate over the list in some direction from some start point.
 
__iter__(self)
Iterate from head to tail over the list, yielding a (node, value) tuple for each element.
 
reverse_iter(self)
Iterate from tail to head over the list, yielding a (node, value) tuple for each element.
 
__getstate__(self)
 
__setstate__(self, state)
 
remove(self, node)
Remove a node from the list.
 
add(self, value)
Add a node to the list.
Method Details [hide private]

_iter_from(self, start, reverse=False)

 

Iterate over the list in some direction from some start point. Common code from __iter__() and reverse_iter().