| Modifier and Type | Field and Description |
|---|---|
double |
height |
double |
width |
double |
x |
double |
y |
| Constructor and Description |
|---|
Rectangle() |
Rectangle(Cog state) |
Rectangle(double x,
double y,
double width,
double height) |
Rectangle(XyBounds bounds) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(double x,
double y) |
Rectangle |
copy() |
boolean |
covers(Rectangle nother)
Returns true if this rectangle covers the given one.
|
boolean |
equals(java.lang.Object nother) |
double |
getArea() |
Point |
getCenter() |
double |
getHeight() |
double |
getMaxX() |
double |
getMaxY() |
double |
getMinX() |
double |
getMinY() |
double |
getWidth() |
double |
getX() |
double |
getY() |
boolean |
intersects(Rectangle nother)
Returns true if the given rectangle intersects this one.
|
void |
setHeight(double argHeight) |
void |
setWidth(double argWidth) |
void |
setX(double argX) |
void |
setY(double argY) |
void |
stretchToInclude(double newX,
double newY) |
void |
stretchToInclude(Rectangle nother) |
Cog |
toCog()
Returns the complete internal state of this object in the form of a
Cog. |
java.lang.String |
toString() |
public double x
public double y
public double width
public double height
public Rectangle()
public Rectangle(double x,
double y,
double width,
double height)
public Rectangle(XyBounds bounds)
public Rectangle(Cog state)
public boolean contains(double x,
double y)
public Cog toCog()
CoggableCog.public double getX()
public void setX(double argX)
public double getY()
public void setY(double argY)
public double getWidth()
public void setWidth(double argWidth)
public double getHeight()
public void setHeight(double argHeight)
public double getArea()
public double getMaxX()
public double getMaxY()
public double getMinX()
public double getMinY()
public boolean intersects(Rectangle nother)
public boolean covers(Rectangle nother)
public void stretchToInclude(double newX,
double newY)
public void stretchToInclude(Rectangle nother)
public boolean equals(java.lang.Object nother)
equals in class java.lang.Objectpublic Point getCenter()
public Rectangle copy()
public java.lang.String toString()
toString in class java.lang.Object