Class XYLine


  • public class XYLine
    extends java.lang.Object
    Represents a line in cartesian space. You can construct the Line directly with double[], double[] x, y arrays coordinates.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      double maxX
      maximum x of this line's bounding box
      double maxY
      maximum y of this line's bounding box
      double minX
      minimum x of this line's bounding box
      double minY
      minimum y of this line's bounding box
      private double[] x
      array of x coordinates
      private double[] y
      array of y coordinates
    • Constructor Summary

      Constructors 
      Constructor Description
      XYLine​(float[] x, float[] y)
      Creates a new Line from the supplied x/y array.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      double[] getX()
      Returns a copy of the internal x array
      double getX​(int vertex)
      Returns x value at given index
      double[] getY()
      Returns a copy of the internal y array
      double getY​(int vertex)
      Returns y value at given index
      int hashCode()  
      int numPoints()
      returns the number of vertex points
      java.lang.String toGeoJSON()
      prints polygons as geojson
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • x

        private final double[] x
        array of x coordinates
      • y

        private final double[] y
        array of y coordinates
      • minX

        public final double minX
        minimum x of this line's bounding box
      • maxX

        public final double maxX
        maximum x of this line's bounding box
      • minY

        public final double minY
        minimum y of this line's bounding box
      • maxY

        public final double maxY
        maximum y of this line's bounding box
    • Constructor Detail

      • XYLine

        public XYLine​(float[] x,
                      float[] y)
        Creates a new Line from the supplied x/y array.
    • Method Detail

      • numPoints

        public int numPoints()
        returns the number of vertex points
      • getX

        public double getX​(int vertex)
        Returns x value at given index
      • getY

        public double getY​(int vertex)
        Returns y value at given index
      • getX

        public double[] getX()
        Returns a copy of the internal x array
      • getY

        public double[] getY()
        Returns a copy of the internal y array
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

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

        public java.lang.String toGeoJSON()
        prints polygons as geojson