public abstract class

Segment

extends Geometry
implements Serializable
java.lang.Object
   ↳ com.esri.core.geometry.Geometry
     ↳ com.esri.core.geometry.Segment
Known Direct Subclasses

Class Overview

A base class for segments. Presently only Line segments are supported.

Summary

[Expand]
Inherited Fields
From class com.esri.core.geometry.Geometry
Public Constructors
Segment()
Creates a segment with start and end points (0,0).
Public Methods
double calculateArea2D()
Calculates the area of the geometry.
void copyTo(Geometry dst)
Copies this geometry to another geometry of the same type.
final int getDimension()
Returns the topological dimension of the geometry object based on the geometry's type.
double getEndX()
Returns the X coordinate of ending point.
double getEndY()
Returns the Y coordinate of ending point.
double getStartX()
Returns the X coordinate of starting point.
double getStartY()
Returns the Y coordinate of starting point.
abstract 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.
final boolean isEmpty()
Indicates if the geometry object contains geometric information.
boolean isEmptyImpl()
Non public abstract version of the function.
void queryEnd(Point dstPoint)
Returns coordinates of the end point in this segment.
void queryStart(Point dstPoint)
Returns coordinates of the start point in a Point class.
final void setEmpty()
Sets the geometry to its original initialization state by releasing all data referenced by the geometry.
void setEnd(Point srcPoint)
Sets the coordinates of the end point in a Point class.
void setStart(Point srcPoint)
Sets the coordinates of the start point in this segment.
[Expand]
Inherited Methods
From class com.esri.core.geometry.Geometry
From class java.lang.Object

Public Constructors

public Segment ()

Creates a segment with start and end points (0,0).

Public Methods

public double calculateArea2D ()

Calculates the area of the geometry. If the spatial reference is a Geographic Coordinate System (WGS84) then the 2D area calculation is defined in angular units.

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

public void copyTo (Geometry dst)

Copies this geometry to another geometry of the same type. The result geometry is an exact copy.

Parameters
dst Geometry

public final int getDimension ()

Returns the topological dimension of the geometry object based on the geometry's type.

Returns 0 for point and multipoint.

Returns 1 for lines and polylines.

Returns 2 for polygons and envelopes

Returns 3 for objects with volume

Returns
int Returns the integer value of the dimension of geometry.

public double getEndX ()

Returns the X coordinate of ending point.

Returns
double The X coordinate of ending point.

public double getEndY ()

Returns the Y coordinate of ending point.

Returns
double The Y coordinate of ending point.

public double getStartX ()

Returns the X coordinate of starting point.

Returns
double The X coordinate of starting point.

public double getStartY ()

Returns the Y coordinate of starting point.

Returns
double The Y coordinate of starting point.

public abstract 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 final boolean isEmpty ()

Indicates if the geometry object contains geometric information. IsEmpty returns true when the geometry object does not contain geometric information beyond its original initialization state.

Returns
boolean boolean Returns true if this geometry is empty.

public boolean isEmptyImpl ()

Non public abstract version of the function.

Returns
boolean

public void queryEnd (Point dstPoint)

Returns coordinates of the end point in this segment.

Parameters
dstPoint Point: The end point of this segment.

public void queryStart (Point dstPoint)

Returns coordinates of the start point in a Point class.

Parameters
dstPoint Point

public final void setEmpty ()

Sets the geometry to its original initialization state by releasing all data referenced by the geometry.

public void setEnd (Point srcPoint)

Sets the coordinates of the end point in a Point class.

Parameters
srcPoint Point: The new end point of this segment.

public void setStart (Point srcPoint)

Sets the coordinates of the start point in this segment.

Parameters
srcPoint Point: The new start point of this segment.