Class Point

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<Point>

    public class Point
    extends java.lang.Object
    implements java.lang.Cloneable, java.lang.Comparable<Point>, java.io.Serializable
    Represents an x,y pair of doubles.

    This x,y pair can be used to represent coordinates for geo-based or other calculations.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Point​(double x, double y)
      Create a new point with coordinate value composed of x and y.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Point clone()  
      static int compare​(double x1, double y1, double x2, double y2)
      Compare 2 raw point values.
      int compareTo​(Point other)
      boolean equals​(java.lang.Object other)
      double getLatitude()  
      double getLongitude()  
      double getX()
      Get the x coordinate value for this point.
      double getY()
      Get the y coordinate value for this point.
      int hashCode()
      void setLatitude​(double value)  
      void setLongitude​(double value)  
      void setX​(double x)
      Set the x coordinate value for this point.
      void setY​(double y)
      Set the y coordinate value for this point.
      java.lang.String toString()
      static java.lang.String toString​(double x, double y)
      Get String representation for raw point value.
      static Point valueOf​(java.lang.Object value)
      Parse value as a 2 double values separated by a comma.
      static Point valueOf​(java.lang.Object value, char sep)
      Parse value as a 2 double values separated by sep.
      static Point valueOf​(java.lang.String value)
      Parse value as a 2 double values separated by a comma.
      static Point valueOf​(java.lang.String value, char sep)
      Parse value as a 2 double values separated by sep.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Point

        public Point​(double x,
                     double y)
        Create a new point with coordinate value composed of x and y.
    • Method Detail

      • getLongitude

        public double getLongitude()
      • setLongitude

        public void setLongitude​(double value)
      • getLatitude

        public double getLatitude()
      • setLatitude

        public void setLatitude​(double value)
      • getX

        public double getX()
        Get the x coordinate value for this point.
      • setX

        public void setX​(double x)
        Set the x coordinate value for this point.
      • getY

        public double getY()
        Get the y coordinate value for this point.
      • setY

        public void setY​(double y)
        Set the y coordinate value for this point.
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • compareTo

        public int compareTo​(Point other)
        Specified by:
        compareTo in interface java.lang.Comparable<Point>
      • compare

        public static int compare​(double x1,
                                  double y1,
                                  double x2,
                                  double y2)
        Compare 2 raw point values.
      • valueOf

        public static Point valueOf​(java.lang.Object value)
        Parse value as a 2 double values separated by a comma.
      • valueOf

        public static Point valueOf​(java.lang.Object value,
                                    char sep)
        Parse value as a 2 double values separated by sep.
      • valueOf

        public static Point valueOf​(java.lang.String value)
        Parse value as a 2 double values separated by a comma.
      • valueOf

        public static Point valueOf​(java.lang.String value,
                                    char sep)
        Parse value as a 2 double values separated by sep.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toString

        public static java.lang.String toString​(double x,
                                                double y)
        Get String representation for raw point value.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • clone

        public Point clone()
        Overrides:
        clone in class java.lang.Object