home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Extras / ODesign / SetupPSE.exe / data.z / OSPoint.java < prev    next >
Encoding:
Java Source  |  1997-01-24  |  677 b   |  45 lines

  1. package COM.odi.demo.OSDraw;
  2.  
  3. /**
  4.  *      <H3>Copyright (C) Object Design Inc. 1996, 1997</H3>
  5.  */
  6.  
  7. import COM.odi.*;
  8. import java.awt.Point;
  9.  
  10. /*
  11.  * Class OSLine is a persistence-capable class
  12.  * Cannot be a discrete instance in the database
  13.  */
  14.  
  15. public class OSPoint {
  16.  
  17.   // Database fields
  18.  
  19.   private int x;
  20.   private int y;
  21.  
  22.   public OSPoint(int x, int y) {
  23.     this.x = x;
  24.     this.y = y;
  25.   }
  26.  
  27.   // Methods to indirectly access private fields
  28.  
  29.   public Point getPoint() {
  30.     return new Point(x, y);
  31.   }
  32.  
  33.   public void setPoint(Point point) {
  34.     x = point.x;
  35.     y = point.y;
  36.   }
  37.  
  38.   // Default hashCode method
  39.  
  40.   public int hashCode() {
  41.     return super.hashCode();
  42.   }
  43. }
  44.  
  45.