Class Point.Double

All Implemented Interfaces:
Geometry, PointTypeGeometry, Serializable, Cloneable
Enclosing class:
Point

public static class Point.Double extends Point
The Double class defines a point specified in double precision.
See Also:
  • Field Details

    • ZERO_ZERO

      public static final Point ZERO_ZERO
    • x

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

      public double y
      The Y coordinate of this Point.
  • Constructor Details

    • Double

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

      public Double(double x, double y)
      Constructs and initializes a Point with the specified coordinates.
      Parameters:
      x - The X coordinate of this Point
      y - The Y coordinate of this Point
    • Double

      public Double(Point point)
  • Method Details

    • clone

      public Point.Double clone()
      Description copied from class: Point
      Clones this geometry.
      Specified by:
      clone in interface Geometry
      Specified by:
      clone in class Point
      Returns:
      a deep copy of the current geometry.
    • getX

      public double getX()
      Returns the X coordinate of this Point in double precision.
      Specified by:
      getX in class Point
      Returns:
      the X coordinate of this Point.
    • getY

      public double getY()
      Returns the Y coordinate of this Point in double precision.
      Specified by:
      getY in class Point
      Returns:
      the Y coordinate of this Point.
    • setLocation

      public void setLocation(double x, double y)
      Sets the location of this Point to the specified double coordinates.
      Specified by:
      setLocation in class Point
      Parameters:
      x - The X coordinate of this Point
      y - The Y coordinate of this Point
    • setX

      public void setX(double x)
      Description copied from class: Point
      Returns the X coordinate of this Point in double precision.
      Specified by:
      setX in class Point
      Parameters:
      x - the X coordinate of this Point.
    • setY

      public void setY(double y)
      Description copied from class: Point
      Sets the Y coordinate of this Point in double precision.
      Specified by:
      setY in class Point
      Parameters:
      y - the Y coordinate of this Point.
    • toString

      public String toString()
      Returns a String that represents the value of this Point.
      Specified by:
      toString in interface Geometry
      Overrides:
      toString in class Object
      Returns:
      a string representation of this Point.
    • getBounds

      public Rectangle getBounds()
      Description copied from interface: Geometry
      Returns the minimum bounding rectangle of this geometry.
      Returns:
      the bounding box of this geometry.
    • translate

      public void translate(double dx, double dy)
      Description copied from class: Point
      Translates the point by the specified offset
      Specified by:
      translate in interface Geometry
      Specified by:
      translate in class Point
      Parameters:
      dx - x value of the translation
      dy - y value of the translation
    • serialize

      public Point[] serialize()
      Description copied from interface: Geometry
      Returns this geometry as an array of Point.
      Returns:
      this geometry as an array of Point.
    • sizeOf

      public int sizeOf()
      Returns an approximation in bytes of the memory used by this geometry.
      Returns:
      the memory used by this geometry.