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

Class LogicNode

source code

object --+
         |
        LogicNode
Known Subclasses:

A class representing nodes in a logic graph

Objects which can be represented as nodes in the AST of a constraint logic graph should inherit from this class, which defines methods for overloading built-in operations.

Instance Methods [hide private]
 
__add__(self, other)
Logic may be defined by using addition to sum logic nodes:
source code
 
__and__(self, other)
Logic may be defined by using the & operator:
source code
 
__or__(self, other)
Logic may be defined by using the | operator:
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__add__(self, other)
(Addition operator)

source code 

Overloads +

Logic may be defined by using addition to sum logic nodes:

   > query.set_logic(con_a + con_b + con_c)
   > str(query.logic)
   ... A and B and C

__and__(self, other)
(And operator)

source code 

Overloads &

Logic may be defined by using the & operator:

   > query.set_logic(con_a & con_b)
   > sr(query.logic)
   ... A and B

__or__(self, other)
(Or operator)

source code 

Overloads |

Logic may be defined by using the | operator:

   > query.set_logic(con_a | con_b)
   > str(query.logic)
   ... A or B