|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.cpsolver.ifs.model.Variable net.sf.cpsolver.ifs.example.rpp.Rectangle
public class Rectangle
Rectangle (variable). It encodes the name, width and height of the rectangle, minimal and maximal position of the rectangle. It also contains an information about prohibited X and Y coordinate (for MPP).
Field Summary |
---|
Fields inherited from class net.sf.cpsolver.ifs.model.Variable |
---|
iId, iValue |
Constructor Summary | |
---|---|
Rectangle(String name,
int width,
int height,
int minX,
int maxX,
int minY,
int maxY,
Location initialLocation)
Constructor. |
Method Summary | |
---|---|
boolean |
equals(Object o)
Compares two rectangles (based on rectangle names) |
int |
getHeight()
Returns height of the rectangle |
int |
getMaxX()
|
int |
getMaxY()
|
int |
getMinX()
|
int |
getMinY()
|
String |
getName()
Returns name of the rectangle |
int |
getProhibitedX()
|
int |
getProhibitedY()
|
int |
getWidth()
Returns width of the rectangle |
boolean |
isProhibited(int x,
int y)
Returns true if the given location is prohibited. |
void |
setBounds(int minX,
int maxX,
int minY,
int maxY)
Set the bounds (minimal and maximal values of X and Y coordinates). |
void |
setProhibited()
Prohibits given initial location (for MPP). |
void |
setProhibited(int x,
int y)
Prohibits given X and Y coordinates (for MPP). |
String |
toString()
String representation (for printing and debugging purposes) |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Rectangle(String name, int width, int height, int minX, int maxX, int minY, int maxY, Location initialLocation)
name
- variable's namewidth
- width of the rectangleheight
- height of the rectangleminX
- minimal X-coordinatemaxX
- maximal X-coordinateminY
- minimal Y-coordinatemaxY
- maximal Y-coordinateinitialLocation
- initial location (null if none)Method Detail |
---|
public void setProhibited(int x, int y)
public void setProhibited()
public boolean isProhibited(int x, int y)
public int getProhibitedX()
public int getProhibitedY()
public int getMinX()
public int getMaxX()
public int getMinY()
public int getMaxY()
public int getWidth()
public int getHeight()
public String getName()
getName
in class Variable
public void setBounds(int minX, int maxX, int minY, int maxY)
public String toString()
toString
in class Variable
public boolean equals(Object o)
equals
in class Variable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |