Class LineString
java.lang.Object
org.apache.tinkerpop.gremlin.structure.geo.Geometry
org.apache.tinkerpop.gremlin.structure.geo.Curve
org.apache.tinkerpop.gremlin.structure.geo.LineString
- All Implemented Interfaces:
Comparable<Geometry>
A line string geometry representing a sequence of connected line segments.
LineStrings are immutable.
- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic LineStringempty()Creates an empty line string withModel.CARTESIANmodel.static LineStringCreates an empty line string with the specified model.booleanExact equality: same type, same SRID, same coordinates (including z flag).inthashCode()Hash code consistent with equals.booleanisEmpty()Returns true if this geometry is empty (has no coordinates).static LineStringCreates a line string from an array of points.points()Returns an unmodifiable list of points in this line string.
-
Method Details
-
of
Creates a line string from an array of points. All points must have the same SRID and z-dimension flag, and none may be empty. A line string must have at least 2 points; useempty()orempty(Model)for an empty line string.- Parameters:
points- the points, at least 2 of them- Returns:
- the line string
- Throws:
IllegalArgumentException- ifpointsis null, if it holds fewer than 2 points, if any element is null, if any element is an empty point, or if the points do not all have the same SRID and the same z dimension- Since:
- 4.0.0
-
empty
Creates an empty line string withModel.CARTESIANmodel.- Returns:
- an empty line string
- Since:
- 4.0.0
-
empty
Creates an empty line string with the specified model.- Parameters:
model-Model.CARTESIANorModel.GEOGRAPHIC- Returns:
- an empty line string
- Throws:
IllegalArgumentException- ifmodelisModel.OTHERor null- Since:
- 4.0.0
-
points
Returns an unmodifiable list of points in this line string.- Returns:
- the points, an empty list when this line string is empty
- Since:
- 4.0.0
-
isEmpty
public boolean isEmpty()Description copied from class:GeometryReturns true if this geometry is empty (has no coordinates). For collections, returns true if all parts are empty. -
equals
Description copied from class:GeometryExact equality: same type, same SRID, same coordinates (including z flag). Coordinates are compared numerically, so -0.0 equals 0.0. -
hashCode
public int hashCode()Description copied from class:GeometryHash code consistent with equals. Zero values are normalized so -0.0 and 0.0 hash alike.
-