2362N/A * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * The <code>Point2D</code> class defines a point representing a location 0N/A * in {@code (x,y)} coordinate space. 0N/A * This class is only the abstract superclass for all objects that 0N/A * store a 2D coordinate. 0N/A * The actual storage representation of the coordinates is left to 0N/A * @author Jim Graham 0N/A * The <code>Float</code> class defines a point specified in float 0N/A * The X coordinate of this <code>Point2D</code>. 0N/A * The Y coordinate of this <code>Point2D</code>. 0N/A * Constructs and initializes a <code>Point2D</code> with 0N/A * coordinates (0, 0). 0N/A * Constructs and initializes a <code>Point2D</code> with 0N/A * the specified coordinates. 0N/A * @param x the X coordinate of the newly 0N/A * constructed <code>Point2D</code> 0N/A * @param y the Y coordinate of the newly 0N/A * constructed <code>Point2D</code> 0N/A * Sets the location of this <code>Point2D</code> to the 0N/A * specified <code>float</code> coordinates. 0N/A * @param x the new X coordinate of this {@code Point2D} 0N/A * @param y the new Y coordinate of this {@code Point2D} 0N/A * Returns a <code>String</code> that represents the value 0N/A * of this <code>Point2D</code>. 0N/A * @return a string representation of this <code>Point2D</code>. 0N/A return "Point2D.Float["+x+
", "+y+
"]";
0N/A * JDK 1.6 serialVersionUID 0N/A * The <code>Double</code> class defines a point specified in 0N/A * <code>double</code> precision. 0N/A * The X coordinate of this <code>Point2D</code>. 0N/A * The Y coordinate of this <code>Point2D</code>. 0N/A * Constructs and initializes a <code>Point2D</code> with 0N/A * coordinates (0, 0). 0N/A * Constructs and initializes a <code>Point2D</code> with the 0N/A * specified coordinates. 0N/A * @param x the X coordinate of the newly 0N/A * constructed <code>Point2D</code> 0N/A * @param y the Y coordinate of the newly 0N/A * constructed <code>Point2D</code> 0N/A * Returns a <code>String</code> that represents the value 0N/A * of this <code>Point2D</code>. 0N/A * @return a string representation of this <code>Point2D</code>. 0N/A return "Point2D.Double["+x+
", "+y+
"]";
0N/A * JDK 1.6 serialVersionUID 0N/A * This is an abstract class that cannot be instantiated directly. 0N/A * Type-specific implementation subclasses are available for 0N/A * instantiation and provide a number of formats for storing 0N/A * the information necessary to satisfy the various accessor 0N/A * @see java.awt.geom.Point2D.Float 0N/A * @see java.awt.geom.Point2D.Double 0N/A * @see java.awt.Point 0N/A * Returns the X coordinate of this <code>Point2D</code> in 0N/A * <code>double</code> precision. 0N/A * @return the X coordinate of this <code>Point2D</code>. 0N/A * Returns the Y coordinate of this <code>Point2D</code> in 0N/A * <code>double</code> precision. 0N/A * @return the Y coordinate of this <code>Point2D</code>. 0N/A * Sets the location of this <code>Point2D</code> to the 0N/A * specified <code>double</code> coordinates. 0N/A * @param x the new X coordinate of this {@code Point2D} 0N/A * @param y the new Y coordinate of this {@code Point2D} 0N/A * Sets the location of this <code>Point2D</code> to the same 0N/A * coordinates as the specified <code>Point2D</code> object. 0N/A * @param p the specified <code>Point2D</code> to which to set 0N/A * this <code>Point2D</code> 0N/A * Returns the square of the distance between two points. 0N/A * @param x1 the X coordinate of the first specified point 0N/A * @param y1 the Y coordinate of the first specified point 0N/A * @param x2 the X coordinate of the second specified point 0N/A * @param y2 the Y coordinate of the second specified point 0N/A * @return the square of the distance between the two 0N/A * sets of specified coordinates. 0N/A * Returns the distance between two points. 0N/A * @param x1 the X coordinate of the first specified point 0N/A * @param y1 the Y coordinate of the first specified point 0N/A * @param x2 the X coordinate of the second specified point 0N/A * @param y2 the Y coordinate of the second specified point 0N/A * @return the distance between the two sets of specified 0N/A * Returns the square of the distance from this 0N/A * <code>Point2D</code> to a specified point. 0N/A * @param px the X coordinate of the specified point to be measured 0N/A * against this <code>Point2D</code> 0N/A * @param py the Y coordinate of the specified point to be measured 0N/A * against this <code>Point2D</code> 0N/A * @return the square of the distance between this 0N/A * <code>Point2D</code> and the specified point. 0N/A * Returns the square of the distance from this 0N/A * <code>Point2D</code> to a specified <code>Point2D</code>. 0N/A * @param pt the specified point to be measured 0N/A * against this <code>Point2D</code> 0N/A * @return the square of the distance between this 0N/A * <code>Point2D</code> to a specified <code>Point2D</code>. 0N/A * Returns the distance from this <code>Point2D</code> to 0N/A * a specified point. 0N/A * @param px the X coordinate of the specified point to be measured 0N/A * against this <code>Point2D</code> 0N/A * @param py the Y coordinate of the specified point to be measured 0N/A * against this <code>Point2D</code> 0N/A * @return the distance between this <code>Point2D</code> 0N/A * and a specified point. 0N/A * Returns the distance from this <code>Point2D</code> to a 0N/A * specified <code>Point2D</code>. 0N/A * @param pt the specified point to be measured 0N/A * against this <code>Point2D</code> 0N/A * @return the distance between this <code>Point2D</code> and 0N/A * the specified <code>Point2D</code>. 0N/A * Creates a new object of the same class and with the 0N/A * same contents as this object. 0N/A * @return a clone of this instance. 0N/A * @exception OutOfMemoryError if there is not enough memory. 0N/A * @see java.lang.Cloneable 0N/A // this shouldn't happen, since we are Cloneable 0N/A * Returns the hashcode for this <code>Point2D</code>. 0N/A * @return a hash code for this <code>Point2D</code>. 0N/A * Determines whether or not two points are equal. Two instances of 0N/A * <code>Point2D</code> are equal if the values of their 0N/A * <code>x</code> and <code>y</code> member fields, representing 0N/A * their position in the coordinate space, are the same. 0N/A * @param obj an object to be compared with this <code>Point2D</code> 0N/A * @return <code>true</code> if the object to be compared is 0N/A * an instance of <code>Point2D</code> and has 0N/A * the same values; <code>false</code> otherwise.