Class Point


  • public final class Point
    extends java.lang.Object
    A two-dimensional coordinate on the canvas.
    • Constructor Summary

      Constructors 
      Constructor Description
      Point​(int x, int y)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int distanceTo​(Point other)
      Gets the distance between this point and another.
      boolean equals​(java.lang.Object o)  
      int getX()  
      int getY()  
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • Point

        public Point​(int x,
                     int y)
    • Method Detail

      • distanceTo

        public int distanceTo​(Point other)
        Gets the distance between this point and another.
        Parameters:
        other - other point
        Returns:
        the distance
      • getX

        public int getX()
      • getY

        public int getY()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

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