Package rdkit :: Package VLib :: Module Supply :: Class SupplyNode
[hide private]
[frames] | no frames]

Class SupplyNode

source code

   object --+    
            |    
Node.VLibNode --+
                |
               SupplyNode
Known Subclasses:

base class for nodes which supply things

Assumptions:
  1) no parents

Usage Example:
  >>> supplier = SupplyNode(contents=[1,2,3])
  >>> supplier.next()
  1
  >>> supplier.next()
  2
  >>> supplier.next()
  3
  >>> supplier.next()
  Traceback (most recent call last):
      ...
  StopIteration
  >>> supplier.reset()
  >>> supplier.next()
  1
  >>> [x for x in supplier]
  [1, 2, 3]
  

Instance Methods [hide private]
 
__init__(self, contents=None, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
reset(self)
resets our iteration state
source code
 
next(self)
part of the iterator interface
source code
 
AddParent(self, parent, notify=1)
>>> p1 = VLibNode()...
source code

Inherited from Node.VLibNode: AddChild, Destroy, GetChildren, GetParents, RemoveChild, RemoveParent, __iter__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, contents=None, **kwargs)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

reset(self)

source code 
resets our iteration state

    

Overrides: Node.VLibNode.reset
(inherited documentation)

next(self)

source code 
part of the iterator interface

raises StopIteration on failure

Overrides: Node.VLibNode.next
(inherited documentation)

AddParent(self, parent, notify=1)

source code 

>>> p1 = VLibNode()
>>> p2 = VLibNode()
>>> c1 = VLibNode()
>>> c1.AddParent(p1)
>>> len(c1.GetParents())
1
>>> len(p1.GetChildren())
1
>>> c1.AddParent(p2,notify=0)
>>> len(c1.GetParents())
2
>>> len(p2.GetChildren())
0
>>> p2.AddChild(c1,notify=0)
>>> len(c1.GetParents())
2
>>> len(p2.GetChildren())
1

Overrides: Node.VLibNode.AddParent
(inherited documentation)