home *** CD-ROM | disk | FTP | other *** search
/ Java Certification Exam Guide / McGrawwHill-JavaCertificationExamGuide.iso / pc / Web Links and Code / code / chap19 / Circle.java < prev   
Encoding:
Java Source  |  1997-04-20  |  604 b   |  34 lines

  1. public class Circle {
  2.    private Point position;
  3.    private int radius;
  4.    private canDelete;
  5.    private canMove;
  6.  
  7.    public Point getPosition() {
  8.       return position;
  9.    }
  10.  
  11.    public void setPosition(Point p) {
  12.       position = p;
  13.    }
  14.  
  15.    public int getRadius() {
  16.       return radius;
  17.    }
  18.  
  19.    public void setRadius(int r) throws IllegalGeometryException {
  20.       if (r < 0)
  21.          throw new IllegalGeometryException();
  22.       radius = r;
  23.    }
  24.  
  25.    public boolean getMove() {
  26.       return canMove;
  27.    }
  28.  
  29.    public boolean getDelete() {
  30.       return canDelete;
  31.    }
  32.  
  33. }
  34.