public void add ( Constraint constr , String ... label ) { checkLabels ( constr . canGenerate ( ) , label ) ; int [ ] ind = convertLabelsToInds ( label ) ; if ( ind . length != constr . getVariableSize ( ) ) { throw new IllegalArgumentException ( "Mapped elements do not match the constraint size." ) ; } // This will also increment lastIndex if necessary add ( constr , ind ) ; if ( ! hasLabel ( label [ label . length - 1 ] ) && constr . canGenerate ( ) ) { label ( label [ label . length - 1 ] , lastIndex ) ; } }
Creates a mapped constraint with the given generative constraint and the indexes it applies . Also labels the last given index .