net.moioli.chart
Class IntRectangle

java.lang.Object
  extended by net.moioli.chart.IntRectangle

public class IntRectangle
extends java.lang.Object

Represents a rectangle on a cartesian plane with integer coordinate.

Version:
2005/10/5
Author:
Silvio Moioli

Field Summary
 int height
          The rectangle's height.
 int width
          The rectangle's width.
 int x
          x coordinate of the rectangle's top-left corner.
 int y
          y coordinate of the rectangle's top-left corner.
 
Constructor Summary
IntRectangle()
          Constructs a rectangle with vertexes in (0,0), (0,1), (1,0), (1,1).
IntRectangle(int x, int y, int width, int height)
          Standard constructor.
IntRectangle(IntRectangle r)
          Copy constructor.
 
Method Summary
 int getHeight()
          Returns the rectangle's height.
 int getWidth()
          Returns the rectangle's width.
 int getX()
          Returns the x coordinate of the rectangle's top-left corner.
 int getY()
          Returns the y coordinate of the rectangle's top-left corner.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public int x
x coordinate of the rectangle's top-left corner.


y

public int y
y coordinate of the rectangle's top-left corner.


width

public int width
The rectangle's width.


height

public int height
The rectangle's height.

Constructor Detail

IntRectangle

public IntRectangle()
Constructs a rectangle with vertexes in (0,0), (0,1), (1,0), (1,1).


IntRectangle

public IntRectangle(IntRectangle r)
Copy constructor.

Parameters:
r - the rectangle to be copied

IntRectangle

public IntRectangle(int x,
                    int y,
                    int width,
                    int height)
Standard constructor.

Parameters:
x - coordinate of the rectangle's top-left corner
y - coordinate of the rectangle's top-left corner
width - the rectangle's width
height - the rectangle's height
Method Detail

getX

public int getX()
Returns the x coordinate of the rectangle's top-left corner.

Returns:
x

getY

public int getY()
Returns the y coordinate of the rectangle's top-left corner.

Returns:
y

getWidth

public int getWidth()
Returns the rectangle's width.

Returns:
the width

getHeight

public int getHeight()
Returns the rectangle's height.

Returns:
the height