Class MultipointBuilder
- java.lang.Object
-
- com.esri.arcgisruntime.geometry.GeometryBuilder
-
- com.esri.arcgisruntime.geometry.MultipointBuilder
-
public final class MultipointBuilder extends GeometryBuilder
Helper class for building immutableMultipoint
geometries. Use the constructors to initialize the builder with a set of Points, and a SpatialReference. Once set, the SpatialReference cannot be changed.Use the mutable PointCollection returned from
getPoints()
to iterate through the contents of the builder, and also call the methods on the PointCollection to add, insert, or remove points from the builder. CalltoGeometry()
to create a new immutable Multipoint from the current values of this builder.- Since:
- 100.0.0
- See Also:
GeometryBuilder
,PointCollection
,Multipoint
-
-
Constructor Summary
Constructors Constructor Description MultipointBuilder(Multipoint multipoint)
Creates a new MultipointBuilder containing the points from the given Multipoint.MultipointBuilder(SpatialReference spatialReference)
Creates a new empty MultipointBuilder with the given SpatialReference.MultipointBuilder(java.lang.Iterable<Point> points)
Creates a new multipoint builder containing a copy of the given iterable of Points.MultipointBuilder(java.lang.Iterable<Point> points, SpatialReference spatialReference)
Creates a new multipoint builder containing a copy of the given iterable of Points, with the given SpatialReference.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GeometryBuilderType
getBuilderType()
Gets the subtype of this builder instance.PointCollection
getPoints()
Gets the PointCollection used by this builder to create a newMultipoint
.boolean
hasM()
Indicates if this builder has m values.boolean
hasZ()
Indicates if this builder has z values.Multipoint
toGeometry()
Returns a new Multipoint based on the current state of this builder.-
Methods inherited from class com.esri.arcgisruntime.geometry.GeometryBuilder
create, create, getExtent, getSpatialReference, hasCurves, isEmpty, isSketchValid, replaceGeometry
-
-
-
-
Constructor Detail
-
MultipointBuilder
public MultipointBuilder(SpatialReference spatialReference)
Creates a new empty MultipointBuilder with the given SpatialReference. SpatialReference cannot be changed after instantiation.- Parameters:
spatialReference
- the SpatialReference of the new builder. May be null.- Since:
- 100.0.0
-
MultipointBuilder
public MultipointBuilder(Multipoint multipoint)
Creates a new MultipointBuilder containing the points from the given Multipoint. The SpatialReference of the new builder will match that of the given Multipoint. Use this constructor in workflows that create a modified version of an existing geometry, for example feature or graphic editing workflows.- Parameters:
multipoint
- the Multipoint used to initialize this builder- Since:
- 100.0.0
-
MultipointBuilder
public MultipointBuilder(java.lang.Iterable<Point> points)
Creates a new multipoint builder containing a copy of the given iterable of Points. The SpatialReference of the new builder will match that of the given Points. If the SpatialReference of any Point is null then it is assumed to have the the same SpatialReference as the first point. If the SpatialReference of all the Points is null, then the SpatialReference of the new MultipointBuilder will also be null.- Parameters:
points
- the set of points used to initialize this builder- Throws:
ArcGISRuntimeException
- ifpoints
contains Points with different SpatialReferences.- Since:
- 100.0.0
-
MultipointBuilder
public MultipointBuilder(java.lang.Iterable<Point> points, SpatialReference spatialReference)
Creates a new multipoint builder containing a copy of the given iterable of Points, with the given SpatialReference. If the SpatialReference of any Point is null then it is assumed to match thespatialReference
parameter.Use this constructor when you have a set of existing points from which to create a Multipoint, but which may not already have a SpatialReference assigned.
- Parameters:
points
- the points used to initialize this builderspatialReference
- the SpatialReference of the new builder- Throws:
ArcGISRuntimeException
- ifpoints
contains Points with different SpatialReferences.- Since:
- 100.0.0
-
-
Method Detail
-
getPoints
public PointCollection getPoints()
Gets the PointCollection used by this builder to create a newMultipoint
. Use this mutable PointCollection to iterate through the contents of the builder. Also use this to change the state of the builder, calling the methods on this PointCollection to add or remove points from the builder. This method always returns a valid collection object; the collection will be empty if the builderGeometryBuilder.isEmpty()
.- Returns:
- the collection of points in this builder, that will be used by
toGeometry()
to create a Multipoint - Since:
- 100.0.0
- See Also:
PointCollection.add(Point)
,PointCollection.remove(int)
-
toGeometry
public Multipoint toGeometry()
Returns a new Multipoint 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 Multipoint each time.- Specified by:
toGeometry
in classGeometryBuilder
- Returns:
- a new Multipoint based on the current state of this builder
- Since:
- 100.0.0
-
getBuilderType
public GeometryBuilderType getBuilderType()
Description copied from class:GeometryBuilder
Gets the subtype of this builder instance. This indicates which type of geometries the builder can create; each type of builder creates a singleGeometryType
.- Overrides:
getBuilderType
in classGeometryBuilder
- Returns:
- the builder subtype
-
hasZ
public boolean hasZ()
Description copied from class:GeometryBuilder
Indicates if this builder has z values. Z values are generally used as a z coordinate, indicating height or elevation. NaN is a valid z value.If true, z values are stored for each vertex of the constructed Geometry. Geometries with z values are created by using setters or constructors that take a z value as a parameter.
- Overrides:
hasZ
in classGeometryBuilder
- Returns:
- true if this builder contains z values, false otherwise
- See Also:
Geometry.hasZ()
-
hasM
public boolean hasM()
Description copied from class:GeometryBuilder
Indicates if this builder has m values. M values are often referred to as measures, and are used in linear referencing workflows on linear datasets. NaN is a valid m value.If true, m values are stored for each vertex of the constructed Geometry. Geometries with m values are created by using setters or constructors that take an m value as a parameter.
- Overrides:
hasM
in classGeometryBuilder
- Returns:
- true if this builder has m values, false otherwise
- See Also:
Geometry.hasM()
-
-