Package intermine :: Module constraints :: Class LogicGroup
[hide private]
[frames] | no frames]

Class LogicGroup

source code

object --+    
         |    
 LogicNode --+
             |
            LogicGroup

A logic node that represents two sub-nodes joined in some way

A logic group is a logic node with two child nodes, which are either connected by AND or by OR logic.

Instance Methods [hide private]
 
__init__(self, left, op, right, parent=None)
Makes a new node composes of two nodes (left and right), and some operator.
source code
 
__repr__(self)
Provide a sensible representation of a node
source code
 
__str__(self)
Provide a human readable version of the group.
source code
 
get_codes(self)
Get a list of all constraint codes used in this group.
source code

Inherited from LogicNode: __add__, __and__, __or__

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

Class Variables [hide private]
  LEGAL_OPS = frozenset(['AND', 'OR'])
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, left, op, right, parent=None)
(Constructor)

source code 

Constructor

Makes a new node composes of two nodes (left and right), and some operator.

Groups may have a reference to their parent.

Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

Provide a sensible representation of a node

Overrides: object.__repr__

__str__(self)
(Informal representation operator)

source code 

Provide a human readable version of the group. The string version should be able to be parsed back into the original logic group.

Overrides: object.__str__