1 /******************************************************************************* 2 * Copyright (c) 2015 Voyager Search and MITRE 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Apache License, Version 2.0 which 5 * accompanies this distribution and is available at 6 * http://www.apache.org/licenses/LICENSE-2.0.txt 7 ******************************************************************************/ 8 9 package org.locationtech.spatial4j.shape; 10 11 /** 12 * A Point with X & Y coordinates. 13 */ 14 public interface Point extends Shape { 15 16 /** 17 * Expert: Resets the state of this shape given the arguments. This is a 18 * performance feature to avoid excessive Shape object allocation as well as 19 * some argument error checking. Mutable shapes is error-prone so use with 20 * care. 21 */ 22 public void reset(double x, double y); 23 24 /** The X coordinate, or Longitude in geospatial contexts. */ 25 public double getX(); 26 27 /** The Y coordinate, or Latitude in geospatial contexts. */ 28 public double getY(); 29 30 /** Convenience method that usually maps on {@link org.locationtech.spatial4j.shape.Point#getY()} */ 31 public default double getLat() { 32 return getY(); 33 } 34 35 /** Convenience method that usually maps on {@link org.locationtech.spatial4j.shape.Point#getX()} */ 36 public default double getLon() { 37 return getX(); 38 } 39 40 }