moagg.types.math
Class Rectangle

java.lang.Object
  extended by moagg.types.math.Rectangle

public class Rectangle
extends java.lang.Object

A custom Rectangle class, since java.awt.Rectangle uses double in its interface (ugh).


Constructor Summary
Rectangle()
           
Rectangle(int x, int y, int w, int h)
           
Rectangle(Rectangle other)
           
 
Method Summary
 boolean contains(Point point)
           
 boolean contains(Rectangle other)
           
 boolean equals(java.lang.Object obj)
           
 Point getCenter()
           
 int getH()
           
 int getW()
           
 int getX()
           
 int getY()
           
 int hashCode()
           
 Rectangle intersect(Rectangle other)
           
 void setH(int h)
           
 void setW(int w)
           
 void setX(int x)
           
 void setY(int y)
           
 java.lang.String toString()
           
 void translate(int x, int y)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rectangle

public Rectangle()

Rectangle

public Rectangle(int x,
                 int y,
                 int w,
                 int h)

Rectangle

public Rectangle(Rectangle other)
Method Detail

getX

public int getX()

setX

public void setX(int x)

getY

public int getY()

setY

public void setY(int y)

getW

public int getW()

setW

public void setW(int w)

getH

public int getH()

setH

public void setH(int h)

translate

public void translate(int x,
                      int y)

contains

public boolean contains(Rectangle other)

contains

public boolean contains(Point point)

getCenter

public Point getCenter()

intersect

public Rectangle intersect(Rectangle other)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

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


Copyright © 2008. All Rights Reserved.