Class Point


  • public class Point
    extends Object
    This class defines a point.
    • Constructor Detail

      • Point

        public Point​(double x,
                     double y)
        Constructs a new point.
        Parameters:
        x - the X position
        y - the Y position
      • Point

        public Point​(Point other)
        Constructs a copy of another point.
        Parameters:
        other - the other point
    • Method Detail

      • getX

        public double getX()
        Returns the X position.
        Returns:
        the X position
      • getY

        public double getY()
        Returns the Y position.
        Returns:
        the Y position
      • set

        public void set​(double x,
                        double y)
        Sets the X and Y position.
        Parameters:
        x - the X position
        y - the Y position
      • offset

        public void offset​(double dx,
                           double dy)
        Moves this point by the specified offset.
        Parameters:
        dx - the offset along the X axis
        dy - the offset along the Y axis
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object