Class ConstraintUtils


  • public final class ConstraintUtils
    extends java.lang.Object
    The ConstraintUtils class provides utility methods to deal with constraints.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Constraint newConstraint​(java.util.Collection<? extends Node> formulae)
      Creates a constraint from the specified collection of formula expressions.
      static Constraint newConstraint​(Node expr)
      Creates a constraint from the specified expression.
      static SolverResult solve​(Constraint constraint)
      Solves the specified constraint with the solver specified as default for the given constraint kind.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • newConstraint

        public static Constraint newConstraint​(Node expr)
        Creates a constraint from the specified expression.
        Parameters:
        expr - Expression to be used as a source for the constraint.
        Returns:
        New formula-based constraint.
        Throws:
        java.lang.IllegalArgumentException - if the argument is null.
      • newConstraint

        public static Constraint newConstraint​(java.util.Collection<? extends Node> formulae)
        Creates a constraint from the specified collection of formula expressions.
        Parameters:
        formulae - Collection of formula expressions.
        Returns:
        New formula-based constraint.
        Throws:
        java.lang.IllegalArgumentException - if the argument is null.
      • solve

        public static SolverResult solve​(Constraint constraint)
        Solves the specified constraint with the solver specified as default for the given constraint kind.
        Parameters:
        constraint - Constraint to be solved.
        Returns:
        Result of solving the constraint.
        Throws:
        java.lang.IllegalArgumentException - if the argument is null.