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

Class ConstraintFactory

source code

object --+
         |
        ConstraintFactory
Known Subclasses:

A factory for creating constraints from a set of arguments.

A constraint factory is responsible for finding an appropriate constraint class for the given arguments and instantiating the constraint.

Instance Methods [hide private]
 
__init__(self)
Constructor -----------
source code
str
get_next_code(self)
Return the available constraint code.
source code
 
make_constraint(self, *args, **kwargs)
Create a constraint from a set of arguments.
source code

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

Class Variables [hide private]
  CONSTRAINT_CLASSES = set([<class 'intermine.constraints.UnaryC...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Constructor
-----------

Creates a new ConstraintFactory

Overrides: object.__init__

get_next_code(self)

source code 

Return the available constraint code.

Returns: str
A single uppercase character

make_constraint(self, *args, **kwargs)

source code 

Create a constraint from a set of arguments.
--------------------------------------------

Finds a suitable constraint class, and instantiates it.

@rtype: Constraint


Class Variable Details [hide private]

CONSTRAINT_CLASSES

Value:
set([<class 'intermine.constraints.UnaryConstraint'>,
     <class 'intermine.constraints.BinaryConstraint'>,
     <class 'intermine.constraints.ListConstraint'>,
     <class 'intermine.constraints.LoopConstraint'>,
     <class 'intermine.constraints.TernaryConstraint'>,
     <class 'intermine.constraints.MultiConstraint'>,
     <class 'intermine.constraints.SubClassConstraint'>])