/*************************************************************************** * Kelli Wiseth * kelli@alameda-tech-lab.com * CIS 255AX * Program name: Point.java * Program Description: A Point class that defines an object that will be used * by the MyLine superclass (via composition). This is the Point3.java * class from the Deitel book, with a few minor modifications (such as * explicitly calling superclass constructor). * Assignment #4 * 29 March 2005 **************************************************************************** */ // Each point has an x and a y coordinate on the graphics plane, which is infinite // in all directions. public class Point { private int x; // x part of coordinate pair private int y; // y part of coordinate pair // no-argument constructor public Point() { // explicit call to Object constructor occurs here; could leave this empty // for implicit call to Object constructor super(); } // constructor that takes two integer values for the x-y coordinates on the // graphics plane public Point( int xValue, int yValue ) { // implicit call to Object constructor x = xValue; y = yValue; } // set x in coordinate pair public void setX( int xValue ) { x = xValue; } // return x from coordinate pair public int getX() { return x; } // set y in coordinate pair public void setY( int yValue ) { y = yValue; } // return y from coordinate pair public int getY() { return y; } } // end class Point