jdsl.geomobj.ref
Class IntLine2D

java.lang.Object
  |
  +--jdsl.geomobj.ref.AbstractGeomObject2D
        |
        +--jdsl.geomobj.ref.AbstractLinearCurve2D
              |
              +--jdsl.geomobj.ref.AbstractIntLinearCurve2D
                    |
                    +--jdsl.geomobj.ref.IntLine2D
All Implemented Interfaces:
Curve2D, GeomObject, GeomObject2D, Line2D, LinearCurve2D, OpenCurve2D

public class IntLine2D
extends AbstractIntLinearCurve2D
implements Line2D

IntLine2D is a Line2D constructed using either two integer points or an integer point and an integer direction.

Version:
$Id: IntLine2D.java,v 1.3 2000/03/23 14:14:30 lv Exp $
Author:
Masi Oka (mao), Luca Vismara (lv)

Inner classes inherited from class jdsl.geomobj.api.GeomObject2D
GeomObject2D.NoneGeomObject2D
 
Fields inherited from class jdsl.geomobj.ref.AbstractIntLinearCurve2D
dir_, p1_, p2_
 
Fields inherited from class jdsl.geomobj.ref.AbstractLinearCurve2D
bottom_, INFINITE, left_, NEGATIVE, POSITIVE, right_, slope_, top_, ZERO
 
Fields inherited from class jdsl.geomobj.ref.AbstractGeomObject2D
gt, jn
 
Fields inherited from interface jdsl.geomobj.api.GeomObject2D
NONE
 
Constructor Summary
IntLine2D(Point2D p, Direction2D dir)
          Creates a line passing through point p with direction dir.
IntLine2D(Point2D p1, Point2D p2)
          Creates a line passing through points p1 and p2; the underlying direction is from p1 to p2.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 
Methods inherited from class jdsl.geomobj.ref.AbstractIntLinearCurve2D
arithmeticType, direction, points
 
Methods inherited from class jdsl.geomobj.ref.AbstractLinearCurve2D
isDecreasing, isHorizontal, isIncreasing, isVertical, toString
 
Methods inherited from class jdsl.geomobj.ref.AbstractGeomObject2D
dim
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jdsl.geomobj.api.LinearCurve2D
direction, isDecreasing, isHorizontal, isIncreasing, isVertical
 
Methods inherited from interface jdsl.geomobj.api.OpenCurve2D
points
 
Methods inherited from interface jdsl.geomobj.api.GeomObject
arithmeticType, dim
 

Constructor Detail

IntLine2D

public IntLine2D(Point2D p,
                 Direction2D dir)
          throws InvalidPointException,
                 InvalidDirectionException
Creates a line passing through point p with direction dir.
Parameters:
p - a point of the line; must be an integer point
dir - the integer direction of the line
Throws:
InvalidPointException - if p is not an integer point
InvalidDirectionException - if dir is not an integer direction

IntLine2D

public IntLine2D(Point2D p1,
                 Point2D p2)
          throws InvalidPointException
Creates a line passing through points p1 and p2; the underlying direction is from p1 to p2.
Parameters:
p1 - a point of the line; must be an integer point
p2 - another point of the line; must be an integer point distinct from p1
Throws:
InvalidPointException - if p1 and p2 are not integer points, or if p1 and p2 are coincident
Method Detail

equals

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