Loading graphics/java/android/graphics/Point.java +19 −10 Original line number Diff line number Diff line Loading @@ -70,19 +70,28 @@ public class Point implements Parcelable { return this.x == x && this.y == y; } @Override public boolean equals(Object o) { if (o instanceof Point) { Point p = (Point) o; return this.x == p.x && this.y == p.y; } return false; @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Point point = (Point) o; if (x != point.x) return false; if (y != point.y) return false; return true; } @Override public int hashCode() { return x * 32713 + y; @Override public int hashCode() { int result = x; result = 31 * result + y; return result; } @Override public String toString() { @Override public String toString() { return "Point(" + x + ", " + y + ")"; } Loading graphics/java/android/graphics/PointF.java +25 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,31 @@ public class PointF implements Parcelable { return this.x == x && this.y == y; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PointF pointF = (PointF) o; if (Float.compare(pointF.x, x) != 0) return false; if (Float.compare(pointF.y, y) != 0) return false; return true; } @Override public int hashCode() { int result = (x != +0.0f ? Float.floatToIntBits(x) : 0); result = 31 * result + (y != +0.0f ? Float.floatToIntBits(y) : 0); return result; } @Override public String toString() { return "PointF(" + x + ", " + y + ")"; } /** * Return the euclidian distance from (0,0) to the point */ Loading Loading
graphics/java/android/graphics/Point.java +19 −10 Original line number Diff line number Diff line Loading @@ -70,19 +70,28 @@ public class Point implements Parcelable { return this.x == x && this.y == y; } @Override public boolean equals(Object o) { if (o instanceof Point) { Point p = (Point) o; return this.x == p.x && this.y == p.y; } return false; @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Point point = (Point) o; if (x != point.x) return false; if (y != point.y) return false; return true; } @Override public int hashCode() { return x * 32713 + y; @Override public int hashCode() { int result = x; result = 31 * result + y; return result; } @Override public String toString() { @Override public String toString() { return "Point(" + x + ", " + y + ")"; } Loading
graphics/java/android/graphics/PointF.java +25 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,31 @@ public class PointF implements Parcelable { return this.x == x && this.y == y; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PointF pointF = (PointF) o; if (Float.compare(pointF.x, x) != 0) return false; if (Float.compare(pointF.y, y) != 0) return false; return true; } @Override public int hashCode() { int result = (x != +0.0f ? Float.floatToIntBits(x) : 0); result = 31 * result + (y != +0.0f ? Float.floatToIntBits(y) : 0); return result; } @Override public String toString() { return "PointF(" + x + ", " + y + ")"; } /** * Return the euclidian distance from (0,0) to the point */ Loading