public final class

Line

extends Segment
implements Serializable
java.lang.Object
   ↳ com.esri.core.geometry.Geometry
     ↳ com.esri.core.geometry.Segment
       ↳ com.esri.core.geometry.Line

Class Overview

A straight line between a pair of points.

Summary

[Expand]
Inherited Fields
From class com.esri.core.geometry.Geometry
Public Constructors
Line()
Creates a line segment.
Public Methods
void applyTransformation(Transformation2D transform)
Applies 2D affine transformation in XY plane.
double calculateLength2D()
Geometry createInstance()
Creates an instance of an empty geometry of the same type.
Geometry.Type getType()
Returns the geometry type.
int intersectionWithAxis2D(boolean bAxisX, double ordinate, double[] resultOrdinates, double[] parameters)
Calculates intersection points of this segment with an infinite line, parallel to one of the axes.
boolean isCurve()
Indicates if the line segment is a curve.
boolean isValid()
Checks if the Line is valid.
void queryEnvelope(Envelope env)
Gets the axis aligned bounding box of the geometry.
[Expand]
Inherited Methods
From class com.esri.core.geometry.Segment
From class com.esri.core.geometry.Geometry
From class java.lang.Object

Public Constructors

public Line ()

Creates a line segment.

Public Methods

public void applyTransformation (Transformation2D transform)

Applies 2D affine transformation in XY plane.

Parameters
transform Transformation2D: The affine transformation to be applied to this geometry.

public double calculateLength2D ()

Returns
double A double value representing the 2D length of the geometry.

public Geometry createInstance ()

Creates an instance of an empty geometry of the same type.

Returns
Geometry

public Geometry.Type getType ()

Returns the geometry type.

Returns
Geometry.Type Returns the geometry type.

public int intersectionWithAxis2D (boolean bAxisX, double ordinate, double[] resultOrdinates, double[] parameters)

Calculates intersection points of this segment with an infinite line, parallel to one of the axes.

Parameters
bAxisX boolean: TRUE if the function works with the line parallel to the axis X.
ordinate double: The ordinate value of the line (x for axis Y, y for axis X).
resultOrdinates double: The value of ordinate in the intersection points One ordinate is equal to the ordinate parameter. This parameter can be NULL.
parameters double: The value of the parameter in the intersection points (between 0 and 1). This parameter can be NULL.
Returns
int The number of intersection points, 0 when no intersection points exist, -1 when the segment coincides with the line (infinite number of intersection points).

public boolean isCurve ()

Indicates if the line segment is a curve.

Returns
boolean

public boolean isValid ()

Checks if the Line is valid. The Line is valid if its start X, start Y, end X, and end Y are all valid doubles, i.e. not NaN.

Returns
boolean true if the Line is valid.

public void queryEnvelope (Envelope env)

Gets the axis aligned bounding box of the geometry.

Parameters
env Envelope: The envelope to return the result in.