jdsl.geomobj.ref
Class IntRectangle2D
java.lang.Object
|
+--jdsl.geomobj.ref.AbstractGeomObject2D
|
+--jdsl.geomobj.ref.IntRectangle2D
- All Implemented Interfaces:
- ClosedCurve2D, Curve2D, GeomObject, GeomObject2D, Rectangle2D
- public class IntRectangle2D
- extends AbstractGeomObject2D
- implements Rectangle2D
This is the class for a two-dimensional rectangle constructed using
two integer points.
- Version:
- $Id: IntRectangle2D.java,v 1.4 2001/05/16 13:44:57 lv Exp $
- Author:
- Luca Vismara (lv)
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
topLeft_
protected IntPoint2D topLeft_
topRight_
protected IntPoint2D topRight_
bottomLeft_
protected IntPoint2D bottomLeft_
bottomRight_
protected IntPoint2D bottomRight_
IntRectangle2D
public IntRectangle2D(Point2D p1,
Point2D p2)
throws InvalidPointException
- Parameters:
p1 - a corner of the rectangle; must be an integer pointp2 - the corner of the rectangle diagonally opposite to p1;
must be an integer point- Throws:
InvalidPointException - if p1 and p2 are not integer
points, or if p1 and p2 are not diagonally opposite
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
arithmeticType
public int arithmeticType()
- Description copied from interface:
GeomObject
- The arithmetic type of a geometric object is encoded as an
integer number. Current legal values are:
0 = an integer geometric object
1 = a rational geometric object
- Specified by:
arithmeticType in interface GeomObject
- Following copied from interface:
jdsl.geomobj.api.GeomObject
- Returns:
- the arithmetic type of this
points
public Point2D[] points()
- Specified by:
points in interface ClosedCurve2D
- Following copied from interface:
jdsl.geomobj.api.ClosedCurve2D
- Returns:
- an array of points defining this; the points are in
clockwise order
topLeftPoint
public Point2D topLeftPoint()
- Specified by:
topLeftPoint in interface Rectangle2D
- Following copied from interface:
jdsl.geomobj.api.Rectangle2D
- Returns:
- the top-left point of this
topRightPoint
public Point2D topRightPoint()
- Specified by:
topRightPoint in interface Rectangle2D
- Following copied from interface:
jdsl.geomobj.api.Rectangle2D
- Returns:
- the top-right point of this
bottomLeftPoint
public Point2D bottomLeftPoint()
- Specified by:
bottomLeftPoint in interface Rectangle2D
- Following copied from interface:
jdsl.geomobj.api.Rectangle2D
- Returns:
- the bottom-left point of this
bottomRightPoint
public Point2D bottomRightPoint()
- Specified by:
bottomRightPoint in interface Rectangle2D
- Following copied from interface:
jdsl.geomobj.api.Rectangle2D
- Returns:
- the bottom-right point of this