JaCoP.constraints
Class Rectangle

java.lang.Object
  extended by JaCoP.constraints.Rectangle

public class Rectangle
extends java.lang.Object

Defines a rectangle used in the diffn constraint.

Version:
3.1
Author:
Krzysztof Kuchcinski and Radoslaw Szymanek

Field Summary
 IntVar[] length
          It specifies the length of the rectangle in each dimension.
 IntVar[] origin
          It specifies the origin of the rectangle in each dimension.
static java.lang.String[] xmlAttributes
          It specifies the arguments required to be saved by an XML format as well as the constructor being called to recreate an object from an XML format.
 
Constructor Summary
Rectangle(java.util.ArrayList<? extends IntVar> list)
          It constructs a rectangle.
Rectangle(IntVar[] list)
          It constructs a rectangle.
Rectangle(IntVar[] length, IntVar[] origin)
          It constructs a rectangle.
Rectangle(Rectangle rect)
          It constructs a rectangle.
 
Method Summary
 boolean domOverlap(Rectangle r)
          It returns true if this rectangle overlaps with a given rectangle.
 int maxLevel()
          It computes the maximum level of any variable constituting the rectangle.
 boolean minLengthEq0()
          It checks if a minimum length in any dimension of the rectangle can be equal 0.
 boolean minUse(int selDimension, JaCoP.constraints.IntRectangle u)
           
 boolean minUse(JaCoP.constraints.IntRectangle u)
           
 boolean settled()
          It checks whether the rectangle is completely fixed.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

length

public IntVar[] length
It specifies the length of the rectangle in each dimension.


origin

public IntVar[] origin
It specifies the origin of the rectangle in each dimension.


xmlAttributes

public static java.lang.String[] xmlAttributes
It specifies the arguments required to be saved by an XML format as well as the constructor being called to recreate an object from an XML format.

Constructor Detail

Rectangle

public Rectangle(IntVar[] length,
                 IntVar[] origin)
It constructs a rectangle.

Parameters:
length - the length of the rectangle in each dimension.
origin - the origin of the rectangle in each dimension.

Rectangle

public Rectangle(IntVar[] list)
It constructs a rectangle.

Parameters:
list - it specifies for each dimension (one after the other) its origin and length.

Rectangle

public Rectangle(java.util.ArrayList<? extends IntVar> list)
It constructs a rectangle.

Parameters:
list - it specifies for each dimension (one after the other) its origin and length.

Rectangle

public Rectangle(Rectangle rect)
It constructs a rectangle.

Parameters:
rect - the rectangle based on which a new rectangle is created.
Method Detail

domOverlap

public boolean domOverlap(Rectangle r)
It returns true if this rectangle overlaps with a given rectangle.

Parameters:
r - the rectangle for which the overlapping is being checked.
Returns:
true if rectangles overlap, false otherwise.

maxLevel

public int maxLevel()
It computes the maximum level of any variable constituting the rectangle.

Returns:
the maximum level.

minLengthEq0

public boolean minLengthEq0()
It checks if a minimum length in any dimension of the rectangle can be equal 0.

Returns:
true if in any dimension the rectangle has minimum possible length equal 0, false otherwise.

minUse

public boolean minUse(int selDimension,
                      JaCoP.constraints.IntRectangle u)

minUse

public boolean minUse(JaCoP.constraints.IntRectangle u)

settled

public boolean settled()
It checks whether the rectangle is completely fixed.

Returns:
true if all variables constituting rectangle are grounded, false otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object