public class Area extends Object
Constructor and Description |
---|
Area(int x1,
int y1,
int x2,
int y2)
Constructs an area object
|
Modifier and Type | Method and Description |
---|---|
int |
getHeight()
Returns the height of the area
|
int |
getWidth()
Returns the width of the area
|
short |
getX1()
Returns x coordinate of left edge of the area
|
short |
getX2()
Returns x coordinate of right edge of the area
|
short |
getY1()
Returns y coordinate of top edge of the area
|
short |
getY2()
Returns y coordinate of bottom edge of the area
|
String |
toString()
Returns a string representation of the object.
|
public Area(int x1, int y1, int x2, int y2)
x1
- x coordinate of left edge of the areay1
- y coordinate of top edge of the areax2
- x coordinate of right edge of the areay2
- y coordinate of bottom edge of the areapublic short getX1()
public short getY1()
public short getX2()
public short getY2()
public int getWidth()
public int getHeight()
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())