java.lang.Object
com.esri.arcgisruntime.geometry.GeometryBuilder
com.esri.arcgisruntime.geometry.PointBuilder
Helper class for building immutable
Point
geometries. Points are the most straightforward geometries to
define, and therefore Point class constructors provide the same options as available on this builder. This builder
class is provided mainly for consistency with other immutable geometries.
Use the constructors to define x,y coordinates, z and m values, and a SpatialReference. Once set, the
SpatialReference cannot be changed. Each other value can also be set individually or later modified by using the
setter methods. Call the toGeometry()
method to create a new immutable Point from the current values of this
builder.
- Since:
- 100.0.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPointBuilder
(double x, double y) Creates a new empty PointBuilder with the given x,y coordinates.PointBuilder
(double x, double y, double z) Creates a new point builder with the given x,y coordinates and z value.PointBuilder
(double x, double y, double z, double m) Creates a new point builder with the given x,y coordinates and z- and m values.PointBuilder
(double x, double y, double z, double m, SpatialReference spatialReference) Creates a new point builder with the given x,y coordinates, z- and m values, and SpatialReference.PointBuilder
(double x, double y, double z, SpatialReference spatialReference) Creates a new point builder with the given x,y coordinates, z value, and SpatialReference.PointBuilder
(double x, double y, SpatialReference spatialReference) Creates a new point builder with the given x,y coordinates and SpatialReference.PointBuilder
(Point point) Creates a new empty PointBuilder from the given Point.PointBuilder
(SpatialReference spatialReference) Creates a new empty PointBuilder with the given SpatialReference. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getM()
Gets the current m value of the point being constructed.double
getX()
Gets the current x coordinate of the point being constructed.double
getY()
Gets the current y coordinate of the point being constructed.double
getZ()
Gets the current z value of the point being constructed.void
offsetBy
(double offsetX, double offsetY) Offsets the point by the given offsets for the x and y dimension.void
setM
(double m) Sets a new m value for the point being constructed.void
setX
(double x) Sets a new x coordinate for the point being constructed.void
setXY
(double x, double y) Sets new x,y coordinates for the point being constructed.void
setY
(double y) Sets a new y coordinate for the point being constructed.void
setZ
(double z) Sets a new z value for the point being constructed.Returns a newPoint
based on the current state of this builder.Methods inherited from class com.esri.arcgisruntime.geometry.GeometryBuilder
create, create, getBuilderType, getExtent, getSpatialReference, hasCurves, hasM, hasZ, isEmpty, isSketchValid, replaceGeometry
-
Constructor Details
-
PointBuilder
Creates a new empty PointBuilder with the given SpatialReference.- Parameters:
spatialReference
- the SpatialReference of the new builder- Since:
- 100.0.0
-
PointBuilder
Creates a new empty PointBuilder from the given Point. The SpatialReference of the new builder will match that of the given Point.- Parameters:
point
- the point to initialize the new builder from- Since:
- 100.0.0
-
PointBuilder
public PointBuilder(double x, double y) Creates a new empty PointBuilder with the given x,y coordinates. The SpatialReference of the new builder will be null.- Parameters:
x
- the x coordinate of the point being constructedy
- the y coordinate of the point being constructed- Since:
- 100.0.0
-
PointBuilder
Creates a new point builder with the given x,y coordinates and SpatialReference.- Parameters:
x
- the x coordinate of the point being constructedy
- the y coordinate of the point being constructedspatialReference
- the SpatialReference of the point being constructed- Since:
- 100.0.0
-
PointBuilder
public PointBuilder(double x, double y, double z) Creates a new point builder with the given x,y coordinates and z value. The SpatialReference of the new builder will be null.- Parameters:
x
- the x coordinate of the point being constructedy
- the y coordinate of the point being constructedz
- the z value of the point being constructed- Since:
- 100.0.0
-
PointBuilder
Creates a new point builder with the given x,y coordinates, z value, and SpatialReference.- Parameters:
x
- the x coordinate of the point being constructedy
- the y coordinate of the point being constructedz
- the z value of the point being constructedspatialReference
- the SpatialReference of the point being constructed- Since:
- 100.0.0
-
PointBuilder
public PointBuilder(double x, double y, double z, double m) Creates a new point builder with the given x,y coordinates and z- and m values. The SpatialReference of the new builder will be null.- Parameters:
x
- the x coordinate of the point being constructedy
- the y coordinate of the point being constructedz
- the z value of the point being constructedm
- the m value of the point being constructed- Since:
- 100.0.0
-
PointBuilder
Creates a new point builder with the given x,y coordinates, z- and m values, and SpatialReference.- Parameters:
x
- the x coordinate of the point being constructedy
- the y coordinate of the point being constructedz
- the z value of the point being constructedm
- the m value of the point being constructedspatialReference
- the SpatialReference of the point being constructed- Since:
- 100.0.0
-
-
Method Details
-
getM
public double getM()Gets the current m value of the point being constructed.- Returns:
- the current m value
- Since:
- 100.0.0
-
setM
public void setM(double m) Sets a new m value for the point being constructed.- Parameters:
m
- the new m value- Since:
- 100.0.0
-
getX
public double getX()Gets the current x coordinate of the point being constructed.- Returns:
- the current x coordinate
- Since:
- 100.0.0
-
setX
public void setX(double x) Sets a new x coordinate for the point being constructed.- Parameters:
x
- the new x coordinate- Since:
- 100.0.0
-
getY
public double getY()Gets the current y coordinate of the point being constructed.- Returns:
- the current y coordinate
- Since:
- 100.0.0
-
setY
public void setY(double y) Sets a new y coordinate for the point being constructed.- Parameters:
y
- the new y coordinate- Since:
- 100.0.0
-
getZ
public double getZ()Gets the current z value of the point being constructed.- Returns:
- the current z value
- Since:
- 100.0.0
- See Also:
-
setZ
public void setZ(double z) Sets a new z value for the point being constructed.The minimum z value is -6,356,752 meters, which is the approximate radius of the earth (the WGS 84 datum semi-minor axis). The maximum z value is 55,000,000 meters. Will return NAN if an error occurs.
- Parameters:
z
- the new z value- Since:
- 100.0.0
- See Also:
-
setXY
public void setXY(double x, double y) Sets new x,y coordinates for the point being constructed.- Parameters:
x
- the x coordinate of the point being constructedy
- the y coordinate of the point being constructed- Since:
- 100.0.0
-
offsetBy
public void offsetBy(double offsetX, double offsetY) Offsets the point by the given offsets for the x and y dimension.- Parameters:
offsetX
- the number of units to move the point on the x axisoffsetY
- the number of units to move the point on the y axis- Since:
- 200.2.0
-
toGeometry
Returns a newPoint
based on the current state of this builder. This method can be called as many times as required for any specific instance; it does not affect the state of the builder, and returns a new Point each time.- Specified by:
toGeometry
in classGeometryBuilder
- Returns:
- a new Point based on the current state of this builder
- Since:
- 100.0.0
-