/* *************************************************************************************** * Copyright (C) 2006 EsperTech, Inc. All rights reserved. * * http://www.espertech.com/esper * * http://www.espertech.com * * ---------------------------------------------------------------------------------- * * The software in this package is published under the terms of the GPL license * * a copy of which has been included with this distribution in the license.txt file. * *************************************************************************************** */ package com.espertech.esper.spatial.quadtree.pointregion; public class XYPoint { protected final double x; protected final double y; public XYPoint(double x, double y) { this.x = x; this.y = y; } public double getX() { return x; } public double getY() { return y; } public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; XYPoint xyPoint = (XYPoint) o; if (Double.compare(xyPoint.x, x) != 0) return false; return Double.compare(xyPoint.y, y) == 0; } public int hashCode() { int result; long temp; temp = Double.doubleToLongBits(x); result = (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(y); result = 31 * result + (int) (temp ^ (temp >>> 32)); return result; } }