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
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, 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)
Rectangle
public Rectangle(XyBounds bounds)
Rectangle
public Rectangle(Cog state)
contains
public boolean contains(double x,
double y)
toCog
public Cog toCog()
- Description copied from interface:
Coggable
- Returns the complete internal state of this object in the form of a
Cog.
- Specified by:
toCog in interface Coggable
- Returns:
- Cog representing the internal state of this object
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()
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object