Class MultiLineString

All Implemented Interfaces:
Comparable<Geometry>

public final class MultiLineString extends MultiCurve
A multi-line string geometry containing zero or more line strings. MultiLineStrings are immutable.
Since:
4.0.0
  • Method Details

    • of

      public static MultiLineString of(LineString... lineStrings)
      Creates a multi-line string from an array of line strings. All line strings must have the same SRID and z-dimension flag. A multi-line string must have at least 1 line string; use empty() or empty(Model) for an empty multi-line string. An element may be an empty line string.
      Parameters:
      lineStrings - the line strings, at least 1 of them
      Returns:
      the multi-line string
      Throws:
      IllegalArgumentException - if lineStrings is null, if it holds no line strings, if any element is null, or if the line strings do not all have the same SRID and the same z dimension
      Since:
      4.0.0
    • empty

      public static MultiLineString empty()
      Creates an empty multi-line string with Model.CARTESIAN model.
      Returns:
      an empty multi-line string
      Since:
      4.0.0
    • empty

      public static MultiLineString empty(Model model)
      Creates an empty multi-line string with the specified model.
      Parameters:
      model - Model.CARTESIAN or Model.GEOGRAPHIC
      Returns:
      an empty multi-line string
      Throws:
      IllegalArgumentException - if model is Model.OTHER or null
      Since:
      4.0.0
    • geometries

      public List<LineString> geometries()
      Returns an unmodifiable list of the line strings in this multi-line string.
      Overrides:
      geometries in class GeometryCollection
      Returns:
      the line strings, an empty list when this multi-line string holds no parts
      Since:
      4.0.0
    • isEmpty

      public boolean isEmpty()
      Description copied from class: Geometry
      Returns true if this geometry is empty (has no coordinates). For collections, returns true if all parts are empty.
      Overrides:
      isEmpty in class GeometryCollection
      Returns:
      true if empty
    • equals

      public boolean equals(Object o)
      Description copied from class: Geometry
      Exact equality: same type, same SRID, same coordinates (including z flag). Coordinates are compared numerically, so -0.0 equals 0.0.
      Overrides:
      equals in class GeometryCollection
    • hashCode

      public int hashCode()
      Description copied from class: Geometry
      Hash code consistent with equals. Zero values are normalized so -0.0 and 0.0 hash alike.
      Overrides:
      hashCode in class GeometryCollection