Class PointFactory.Point2D

java.lang.Object
com.graphbuilder.geom.PointFactory.Point2D
All Implemented Interfaces:
Point, Point2d
Enclosing class:
PointFactory

static class PointFactory.Point2D extends Object implements Point2d
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) double[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Point2D(double x, double y)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    Returns either a new array or internal temporary array with a copy of the data or a direct reference to the array.
    double
    Returns the x-coordinate.
    double
    Returns the y-coordinate.
    void
    setLocation(double[] p)
    Sets the location of the point.
    void
    setLocation(double x, double y)
    Sets the location of the point.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • pts

      double[] pts
  • Constructor Details

    • Point2D

      public Point2D(double x, double y)
  • Method Details

    • getX

      public double getX()
      Description copied from interface: Point2d
      Returns the x-coordinate.
      Specified by:
      getX in interface Point2d
    • getY

      public double getY()
      Description copied from interface: Point2d
      Returns the y-coordinate.
      Specified by:
      getY in interface Point2d
    • setLocation

      public void setLocation(double[] p)
      Description copied from interface: Point
      Sets the location of the point. Some implementations may copy the values of the array or may set the internal reference to the array. Some implementations may check the length of the array or the values. If the values need to be restricted, then the getLocation() method should return a copy of the data.
      Specified by:
      setLocation in interface Point
    • setLocation

      public void setLocation(double x, double y)
      Description copied from interface: Point2d
      Sets the location of the point.
      Specified by:
      setLocation in interface Point2d
    • getLocation

      public double[] getLocation()
      Description copied from interface: Point
      Returns either a new array or internal temporary array with a copy of the data or a direct reference to the array. In the case where a copy is returned and later modified, the setLocation must be called to apply the data. The values in the returned array must represent the absolute location of the point.
      Specified by:
      getLocation in interface Point