Class PointBuilder

java.lang.Object
com.esri.arcgisruntime.geometry.GeometryBuilder
com.esri.arcgisruntime.geometry.PointBuilder

public final class PointBuilder extends GeometryBuilder
The point builder allows you to create and modify point geometries incrementally.

Point geometries are immutable and cannot be changed directly once created. The PointBuilder has a number of constructors to allow you to create a new point, or you can edit an existing point using setXY(double, double) or offsetBy(double, double). Use GeometryBuilder.toGeometry() to return the new Point from the builder.

Since:
100.0.0
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    PointBuilder(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.
    Creates a point builder from the specified point.
    PointBuilder(SpatialReference spatialReference)
    Creates an empty point builder with the specified SpatialReference.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Gets the current m value of the point being constructed.
    double
    Gets the current x coordinate of the point being constructed.
    double
    Gets the current y coordinate of the point being constructed.
    double
    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 new Point 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PointBuilder

      public PointBuilder(SpatialReference spatialReference)
      Creates an empty point builder with the specified SpatialReference.

      The SpatialReference cannot be changed after instantiation.

      Parameters:
      spatialReference - the SpatialReference of the new builder
      Since:
      100.0.0
    • PointBuilder

      public PointBuilder(Point point)
      Creates a point builder from the specified point.

      The SpatialReference of the new point builder will match that of the specified 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 constructed
      y - the y coordinate of the point being constructed
      Since:
      100.0.0
    • PointBuilder

      public PointBuilder(double x, double y, SpatialReference spatialReference)
      Creates a new point builder with the given x,y coordinates and SpatialReference.
      Parameters:
      x - the x coordinate of the point being constructed
      y - the y coordinate of the point being constructed
      spatialReference - 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 constructed
      y - the y coordinate of the point being constructed
      z - the z value of the point being constructed
      Since:
      100.0.0
    • PointBuilder

      public PointBuilder(double x, double y, double z, SpatialReference spatialReference)
      Creates a new point builder with the given x,y coordinates, z value, and SpatialReference.
      Parameters:
      x - the x coordinate of the point being constructed
      y - the y coordinate of the point being constructed
      z - the z value of the point being constructed
      spatialReference - 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 constructed
      y - the y coordinate of the point being constructed
      z - the z value of the point being constructed
      m - the m value of the point being constructed
      Since:
      100.0.0
    • PointBuilder

      public 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.
      Parameters:
      x - the x coordinate of the point being constructed
      y - the y coordinate of the point being constructed
      z - the z value of the point being constructed
      m - the m value of the point being constructed
      spatialReference - 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 constructed
      y - 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 axis
      offsetY - the number of units to move the point on the y axis
      Since:
      200.2.0
    • toGeometry

      public Point toGeometry()
      Returns a new Point 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 class GeometryBuilder
      Returns:
      a new Point based on the current state of this builder
      Since:
      100.0.0