com.partnersoft.geometry
Class Rectangle

java.lang.Object
  extended by com.partnersoft.geometry.Rectangle
All Implemented Interfaces:
Coggable

public class Rectangle
extends java.lang.Object
implements Coggable


Field Summary
 double height
           
 double width
           
 double x
           
 double y
           
 
Constructor Summary
Rectangle()
           
Rectangle(double x, double y, double width, double height)
           
 
Method Summary
 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()
           
 Cog getState()
           
 double getWidth()
           
 double getX()
           
 double getY()
           
 boolean intersects(Rectangle nother)
          Returns true if the given rectangle intersects this one.
 void setHeight(double argHeight)
           
 void setState(Cog state)
           
 void setWidth(double argWidth)
           
 void setX(double argX)
           
 void setY(double argY)
           
 void stretchToInclude(double newX, double newY)
           
 void stretchToInclude(Rectangle nother)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public double x

y

public double y

width

public double width

height

public double height
Constructor Detail

Rectangle

public Rectangle()

Rectangle

public Rectangle(double x,
                 double y,
                 double width,
                 double height)
Method Detail

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()

toString

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