Class Point


  • public class Point
    extends java.lang.Object
    The Location class defines a point specified in double precision.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      double x
      The X coordinate of this Location.
      double y
      The Y coordinate of this Location.
    • Constructor Summary

      Constructors 
      Constructor Description
      Point()
      Constructs and initializes a Location with coordinates (0, 0).
      Point​(double x, double y)
      Constructs and initializes a Location with the specified coordinates.
      Point​(Location lo)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getX()
      Returns the X coordinate of this Location in double precision.
      double getY()
      Returns the Y coordinate of this Location in double precision.
      void setLocation​(double x, double y)
      Sets the location of this Location to the specified double coordinates.
      void setX​(double x)  
      void setY​(double y)  
      java.lang.String toString()
      Returns a String that represents the value of this Location.
      void translate​(double dTranslateX, double dTranslateY)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • x

        public double x
        The X coordinate of this Location.
      • y

        public double y
        The Y coordinate of this Location.
    • Constructor Detail

      • Point

        public Point()
        Constructs and initializes a Location with coordinates (0, 0).
      • Point

        public Point​(double x,
                     double y)
        Constructs and initializes a Location with the specified coordinates.
        Parameters:
        x - , y the coordinates to which to set the newly constructed Location
    • Method Detail

      • getX

        public double getX()
        Returns the X coordinate of this Location in double precision.
        Returns:
        the X coordinate of this Location.
      • getY

        public double getY()
        Returns the Y coordinate of this Location in double precision.
        Returns:
        the Y coordinate of this Location.
      • setLocation

        public void setLocation​(double x,
                                double y)
        Sets the location of this Location to the specified double coordinates.
        Parameters:
        x - , y the coordinates to which to set this Location
      • toString

        public java.lang.String toString()
        Returns a String that represents the value of this Location.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this Location.
      • setX

        public void setX​(double x)
      • setY

        public void setY​(double y)
      • translate

        public void translate​(double dTranslateX,
                              double dTranslateY)