jopt.csp.variable
Interface CspNumExpr

All Known Subinterfaces:
CspBooleanExpr, CspBooleanVariable, CspDoubleCast, CspDoubleExpr, CspDoubleVariable, CspFloatCast, CspFloatExpr, CspFloatVariable, CspGenericBooleanExpr, CspGenericDoubleCast, CspGenericDoubleExpr, CspGenericFloatCast, CspGenericFloatExpr, CspGenericIntExpr, CspGenericLongCast, CspGenericLongExpr, CspGenericNumExpr, CspIntExpr, CspIntVariable, CspLongCast, CspLongExpr, CspLongVariable, CspNumVariable

public interface CspNumExpr

Base interface for numeric-based expressions


Method Summary
 CspConstraint between(CspGenericNumConstant min, boolean minExclusive, CspGenericNumConstant max, boolean maxExclusive)
          Returns a constraint restricting this expression to be between a min and max.
 CspConstraint between(CspGenericNumConstant min, CspGenericNumConstant max)
          Returns a constraint restricting this expression to be between or equal min and max.
 CspConstraint between(CspNumExpr min, boolean minExclusive, CspNumExpr max, boolean maxExclusive)
          Returns a constraint restricting this expression to be between a min and max.
 CspConstraint between(CspNumExpr min, CspNumExpr max)
          Returns a constraint restricting this expression to be between or equal min and max.
 CspConstraint eq(CspNumExpr val)
          Returns a constraint restricting this expression to a value
 CspConstraint geq(CspNumExpr val)
          Returns a constraint restricting this expression to values above and including a given minimum
 java.lang.String getName()
          Returns the name of this expression
 CspConstraint gt(CspNumExpr val)
          Returns a constraint restricting this expression to values above a given minimum
 boolean isBound()
          Returns true if this expression's domain is bound to a value
 CspConstraint leq(CspNumExpr val)
          Returns a constraint restricting this expression to values below and including a given maximum
 CspConstraint lt(CspNumExpr val)
          Returns a constraint restricting this expression to values below a given maximum
 CspConstraint neq(CspNumExpr val)
          Returns a constraint restricting this expression to all values not equivalent to supplied value
 CspConstraint notBetween(CspGenericNumConstant min, boolean minExclusive, CspGenericNumConstant max, boolean maxExclusive)
          Returns a constraint restricting this expression to not fall within a given range from a min to max value
 CspConstraint notBetween(CspGenericNumConstant min, CspGenericNumConstant max)
          Returns a constraint restricting this expression to not fall within a given range greater than or equal to a min value up to less than or equal a max value
 CspConstraint notBetween(CspNumExpr min, boolean minExclusive, CspNumExpr max, boolean maxExclusive)
          Returns a constraint restricting this expression to not fall within a given range from a min to max value
 CspConstraint notBetween(CspNumExpr min, CspNumExpr max)
          Returns a constraint restricting this expression to not fall within a given range greater than or equal to a min value up to less than or equal a max value
 void setName(java.lang.String name)
          Sets the name of this expression
 

Method Detail

getName

public java.lang.String getName()
Returns the name of this expression

Returns:
name of this expression

setName

public void setName(java.lang.String name)
Sets the name of this expression

Parameters:
name - new name for this expression

eq

public CspConstraint eq(CspNumExpr val)
Returns a constraint restricting this expression to a value

Parameters:
val - expression to constain this expression to
Returns:
constraint constraining this expression to be equal to val

lt

public CspConstraint lt(CspNumExpr val)
Returns a constraint restricting this expression to values below a given maximum

Parameters:
val - expression to constain this expression to
Returns:
constraint constraining this expression to be less than val

leq

public CspConstraint leq(CspNumExpr val)
Returns a constraint restricting this expression to values below and including a given maximum

Parameters:
val - expression to constain this expression to
Returns:
constraint constraining this expression to be less than or equal to val

gt

public CspConstraint gt(CspNumExpr val)
Returns a constraint restricting this expression to values above a given minimum

Parameters:
val - expression to constain this expression to
Returns:
constraint constraining this expression to be greater than val

geq

public CspConstraint geq(CspNumExpr val)
Returns a constraint restricting this expression to values above and including a given minimum

Parameters:
val - expression to constain this expression to
Returns:
constraint constraining this expression to be greater than or equal to val

neq

public CspConstraint neq(CspNumExpr val)
Returns a constraint restricting this expression to all values not equivalent to supplied value

Parameters:
val - expression to constain this expression to
Returns:
constraint constraining this expression to be not equal to val

between

public CspConstraint between(CspNumExpr min,
                             boolean minExclusive,
                             CspNumExpr max,
                             boolean maxExclusive)
Returns a constraint restricting this expression to be between a min and max.

Parameters:
min - value that this expression must be greater than
minExclusive - true if start of range does not include minimum value
max - value that this expression must be less than
maxExclusive - true if end of range does not include maximum value
Returns:
constraint restricting this expression to be between a min and max.

between

public CspConstraint between(CspNumExpr min,
                             CspNumExpr max)
Returns a constraint restricting this expression to be between or equal min and max.

Parameters:
min - value that this expression must be greater than
max - value that this expression must be less than
Returns:
constraint restricting this expression to be between or equal to min and max

between

public CspConstraint between(CspGenericNumConstant min,
                             boolean minExclusive,
                             CspGenericNumConstant max,
                             boolean maxExclusive)
Returns a constraint restricting this expression to be between a min and max.

Parameters:
min - value that this expression must be greater than
minExclusive - true if start of range does not include minimum value
max - value that this expression must be less than
maxExclusive - true if end of range does not include maximum value
Returns:
constraint restricting this expression to be between a min and max.

between

public CspConstraint between(CspGenericNumConstant min,
                             CspGenericNumConstant max)
Returns a constraint restricting this expression to be between or equal min and max.

Parameters:
min - value that this expression must be greater than
max - value that this expression must be less than
Returns:
constraint restricting this expression to be between or equal to min and max

notBetween

public CspConstraint notBetween(CspNumExpr min,
                                boolean minExclusive,
                                CspNumExpr max,
                                boolean maxExclusive)
Returns a constraint restricting this expression to not fall within a given range from a min to max value

Parameters:
min - start of values that this expression may not contain
minExclusive - true if start of range does not include minimum value
max - start of values that this expression may not contain
maxExclusive - true if end of range does not include maximum value
Returns:
constraint restricting this expression to not fall within a given range

notBetween

public CspConstraint notBetween(CspNumExpr min,
                                CspNumExpr max)
Returns a constraint restricting this expression to not fall within a given range greater than or equal to a min value up to less than or equal a max value

Parameters:
min - start of values that this expression may not contain
max - start of values that this expression may not contain
Returns:
constraint restricting this expression to not fall within a given range

notBetween

public CspConstraint notBetween(CspGenericNumConstant min,
                                boolean minExclusive,
                                CspGenericNumConstant max,
                                boolean maxExclusive)
Returns a constraint restricting this expression to not fall within a given range from a min to max value

Parameters:
min - start of values that this expression may not contain
minExclusive - true if start of range does not include minimum value
max - start of values that this expression may not contain
maxExclusive - true if end of range does not include maximum value
Returns:
constraint restricting this expression to not fall within a given range

notBetween

public CspConstraint notBetween(CspGenericNumConstant min,
                                CspGenericNumConstant max)
Returns a constraint restricting this expression to not fall within a given range greater than or equal to a min value up to less than or equal a max value

Parameters:
min - start of values that this expression may not contain
max - start of values that this expression may not contain
Returns:
constraint restricting this expression to not fall within a given range

isBound

public boolean isBound()
Returns true if this expression's domain is bound to a value

Returns:
true if expression domain is bound to a single value