Interface FunctionalInterfaces.Intx2ToDom

  • Enclosing interface:
    FunctionalInterfaces
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public static interface FunctionalInterfaces.Intx2ToDom
    Represents a function that associates an integer domain (possibly, null) with a given pair of integers. This is a functional interface whose functional method is apply(int,int) . This may be useful when building 2-dimensional arrays of integer variables as for example in:
     Var[][] = array("x", size(10, 5), (i,j) -> i < j ? dom(range(10)) : dom(0,1));
     
    On our example, some variables have a domain containing 10 values whereas others have a domain containing two values only.
    • Method Detail

      • apply

        Domains.Dom apply​(int i,
                          int j)
        Returns an integer domain, computed from the specified integers.
        Parameters:
        i - a first integer
        j - a second integer
        Returns:
        an integer domain (possibly null), computed from the specified integers