Class ContourPlot.PointeredPoint2D

  • All Implemented Interfaces:
    java.lang.Cloneable
    Enclosing class:
    ContourPlot

    public class ContourPlot.PointeredPoint2D
    extends java.awt.geom.Point2D
    The PointeredPoint2D class is an implementation of the Point2D class that uses two double arrays of size 1 to store its x and y coordinate. This allows for referencing the x or y coordinate elsewhere (kind of as a pointer to the value) e.g. in another PointeredPoint2D so that 2 points can share a coordinate, for example points on the same axis.
    Author:
    hageldave
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.awt.geom.Point2D

        java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float
    • Field Summary

      Fields 
      Modifier and Type Field Description
      double[] x
      'pointer' to x coordinate
      double[] y
      'pointer' to y coordinate
    • Constructor Summary

      Constructors 
      Constructor Description
      PointeredPoint2D()
      Creates point at (0,0)
      PointeredPoint2D​(double[] xptr, double[] yptr)
      Creates point using the specified arrays as pointers for this point's coordinates
      PointeredPoint2D​(double x, double y)
      Creates point at (x,y)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()  
      double getX()  
      double getY()  
      void setLocation​(double x, double y)  
      java.lang.String toString()  
      • Methods inherited from class java.awt.geom.Point2D

        distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode, setLocation
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • x

        public final double[] x
        'pointer' to x coordinate
      • y

        public final double[] y
        'pointer' to y coordinate
    • Constructor Detail

      • PointeredPoint2D

        public PointeredPoint2D()
        Creates point at (0,0)
      • PointeredPoint2D

        public PointeredPoint2D​(double x,
                                double y)
        Creates point at (x,y)
        Parameters:
        x - coordinate
        y - coordinate
      • PointeredPoint2D

        public PointeredPoint2D​(double[] xptr,
                                double[] yptr)
        Creates point using the specified arrays as pointers for this point's coordinates
        Parameters:
        xptr - array to use as pointer to x coordinate
        yptr - array to use as pointer to y coordinate
    • Method Detail

      • getX

        public double getX()
        Specified by:
        getX in class java.awt.geom.Point2D
      • getY

        public double getY()
        Specified by:
        getY in class java.awt.geom.Point2D
      • setLocation

        public void setLocation​(double x,
                                double y)
        Specified by:
        setLocation in class java.awt.geom.Point2D
      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class java.awt.geom.Point2D
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object