1 11 package org.eclipse.swt.graphics; 12 13 14 import org.eclipse.swt.internal.SerializableCompatibility; 15 16 39 40 public final class Point implements SerializableCompatibility { 41 42 45 public int x; 46 47 50 public int y; 51 52 static final long serialVersionUID = 3257002163938146354L; 53 54 60 public Point (int x, int y) { 61 this.x = x; 62 this.y = y; 63 } 64 65 75 public boolean equals (Object object) { 76 if (object == this) return true; 77 if (!(object instanceof Point)) return false; 78 Point p = (Point)object; 79 return (p.x == this.x) && (p.y == this.y); 80 } 81 82 92 public int hashCode () { 93 return x ^ y; 94 } 95 96 102 public String toString () { 103 return "Point {" + x + ", " + y + "}"; } 105 106 } 107 108 | Popular Tags |