Package com.facilita.fc.eggPlant
Class Rectangle
- java.lang.Object
-
- com.facilita.fc.eggPlant.Rectangle
-
public class Rectangle extends java.lang.Object
Represents an area of the screen.
-
-
Constructor Summary
Constructors Constructor Description Rectangle(int x1, int y1, int x2, int y2)
Instantiates a new Rectangle.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Point
bottomRight()
Get a Point representing the location of the top left corner of the Rectangle.boolean
equals(java.lang.Object other)
int
hashCode()
Point
topLeft()
Get a Point representing the location of the top left corner of the Rectangle.java.lang.String
toString()
-
-
-
Constructor Detail
-
Rectangle
public Rectangle(int x1, int y1, int x2, int y2)
Instantiates a new Rectangle.- Parameters:
x1
- the x coordinate of the top left cornery1
- the y coordinate of the top left cornerx2
- the x coordinate of the bottom right cornery2
- the y coordinate of the bottom right corner
-
-
Method Detail
-
topLeft
public Point topLeft()
Get a Point representing the location of the top left corner of the Rectangle.- Returns:
- the point
-
bottomRight
public Point bottomRight()
Get a Point representing the location of the top left corner of the Rectangle.- Returns:
- the point
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-