public void addConstraint ( Constraint constraint ) { if ( ConstraintType . ALPHA . equals ( constraint . getType ( ) ) ) { this . addAlphaConstraint ( ( AlphaNodeFieldConstraint ) constraint ) ; } else if ( ConstraintType . BETA . equals ( constraint . getType ( ) ) ) { this . addBetaConstraint ( ( BetaNodeFieldConstraint ) constraint ) ; } else { throw new RuntimeException ( "Constraint type MUST be known in advance." ) ; } }
Adds a constraint too all lists it belongs to by checking for its type