com.partnersoft.geometry
Class Rectangle
java.lang.Object
com.partnersoft.geometry.Rectangle
- All Implemented Interfaces:
- Coggable
public class Rectangle
- extends java.lang.Object
- implements Coggable
|
Constructor Summary |
Rectangle()
|
Rectangle(double x,
double y,
double width,
double height)
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
x
public double x
y
public double y
width
public double width
height
public double height
Rectangle
public Rectangle()
Rectangle
public Rectangle(double x,
double y,
double width,
double height)
contains
public boolean contains(double x,
double y)
setState
public void setState(Cog state)
- Specified by:
setState in interface Coggable
getState
public Cog getState()
- Specified by:
getState in interface Coggable
getX
public double getX()
setX
public void setX(double argX)
getY
public double getY()
setY
public void setY(double argY)
getWidth
public double getWidth()
setWidth
public void setWidth(double argWidth)
getHeight
public double getHeight()
setHeight
public void setHeight(double argHeight)
getArea
public double getArea()
getMaxX
public double getMaxX()
getMaxY
public double getMaxY()
getMinX
public double getMinX()
getMinY
public double getMinY()
intersects
public boolean intersects(Rectangle nother)
- Returns true if the given rectangle intersects this one.
covers
public boolean covers(Rectangle nother)
- Returns true if this rectangle covers the given one.
stretchToInclude
public void stretchToInclude(double newX,
double newY)
stretchToInclude
public void stretchToInclude(Rectangle nother)
equals
public boolean equals(java.lang.Object nother)
- Overrides:
equals in class java.lang.Object
getCenter
public Point getCenter()
copy
public Rectangle copy()