Package breadboards

Class GPoint


  • public class GPoint
    extends java.lang.Object
    Class whose objects are coordinates (x,y) where these coordinates are stored as doubles
    Author:
    paul oser
    • Constructor Summary

      Constructors 
      Constructor Description
      GPoint()
      constructs a GPoint where (x,y) = (0,0)
      GPoint​(double x, double y)
      constructs a GPoint with the specified coordinates
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getX()
      returns the GPoint's x-coordinate
      double getY()
      returns the GPoint's y-coordinate
      void setLocation​(double x, double y)
      sets the location of the GPoint to the specified location
      void translate​(double dx, double dy)
      translates the GPoint dx units to the right (left if negative) and dy units down (up if negative)
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GPoint

        public GPoint()
        constructs a GPoint where (x,y) = (0,0)
      • GPoint

        public GPoint​(double x,
                      double y)
        constructs a GPoint with the specified coordinates
        Parameters:
        x - the specified x-coordinate
        y - the specified y-coordinate
    • Method Detail

      • getX

        public double getX()
        returns the GPoint's x-coordinate
        Returns:
        the GPoint's x-coordinate
      • getY

        public double getY()
        returns the GPoint's y-coordinate
        Returns:
        the GPoint's y-coordinate
      • setLocation

        public void setLocation​(double x,
                                double y)
        sets the location of the GPoint to the specified location
        Parameters:
        x - the specified x-coordinate
        y - the specified y-coordinate
      • translate

        public void translate​(double dx,
                              double dy)
        translates the GPoint dx units to the right (left if negative) and dy units down (up if negative)
        Parameters:
        dx - distance to move GPoint to the right (left if negative)
        dy - distance to move GPoint down (up if negative)