Class LineString

  • All Implemented Interfaces:
    java.io.Serializable

    public final class LineString
    extends EField
    Contains two or more Positions used to define a "line". The reason for the quotes is the the points may form a figure which may cross itself, form a closed polygon, or define a curve. It does not have to define a straight line.
    Author:
    Charles W. Rapp
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  LineString.Builder
      Builder class used to create LineString instances.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      Position[] positions
      The multiple points defining this line string.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static LineString.Builder builder()
      Returns a new line string builder instance.
      boolean equals​(java.lang.Object o)
      Returns true if o is a non-null Linestring with a position array equaling this LineString position array.
      int hashCode()
      Returns hash code of contained positions.
      boolean isClosed()
      Returns true if this line string has three or more positions and the first and last position are equal; otherwise returns false
      java.lang.String toString()
      Returns a single text line containing all the line string positions.
      • Methods inherited from class java.lang.Object

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

      • positions

        public final Position[] positions
        The multiple points defining this line string.
    • Method Detail

      • toString

        public java.lang.String toString()
        Returns a single text line containing all the line string positions.
        Overrides:
        toString in class java.lang.Object
        Returns:
        text containing line string positions.
      • equals

        public boolean equals​(java.lang.Object o)
        Returns true if o is a non-null Linestring with a position array equaling this LineString position array. Otherwise returns false.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - comparison object.
        Returns:
        true if o is a non-null Linestring with a position array equaling this LineString position array.
      • hashCode

        public int hashCode()
        Returns hash code of contained positions.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        contained positions hash code.
      • isClosed

        public boolean isClosed()
        Returns true if this line string has three or more positions and the first and last position are equal; otherwise returns false
        Returns:
        true if contains > 2 positions and the first and last positions are equal.
      • builder

        public static LineString.Builder builder()
        Returns a new line string builder instance.
        Returns:
        new line string builder instance.