Class Coordinates

java.lang.Object
collection.City.Coordinates

public class Coordinates extends Object
Class representing coordinates
  • Constructor Details

    • Coordinates

      public Coordinates(int x, double y)
      Constructor for creating Coordinates object
      Parameters:
      x - - coordinate x value
      y - - coordinate y value
    • Coordinates

      public Coordinates()
  • Method Details

    • getX

      public int getX()
    • setX

      public void setX(int x)
    • getY

      public double getY()
    • setY

      public void setY(double y)
    • compareTo

      public int compareTo(Coordinates o)
      Compares two Coordinates objects by their x and y values
      Parameters:
      o - - Coordinates object to compare
      Returns:
      - negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object