All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javax.constraints.impl.constraint.Neg Maven / Gradle / Ivy

Go to download

This is a JSR331 interface for the open source Java constraint programming library "Sugar" v. 2.1.3

The newest version!
package javax.constraints.impl.constraint;

import javax.constraints.impl.Problem;
import javax.constraints.impl.Constraint;

import jp.kobe_u.sugar.expression.Expression;

/**
 * An implementation of the Constraint "Neg"
 */
public class Neg extends Constraint {

    public Neg(javax.constraints.Constraint c1) {
        super(c1.getProblem(), "neg"); 
        Problem p = (Problem)getProblem();
        sugarNot(p.toExpr(c1));
    }
    
    private void sugarNot(Expression c1) {
        Expression c = Expression.create(new Expression[] {
                Expression.NOT,
                c1
        });
        _setImpl(c);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy