com.esri.adf.web.data.geometry
Class WebPointCollection

java.lang.Object
  extended by com.esri.adf.web.data.geometry.WebGeometry
      extended by com.esri.adf.web.data.geometry.WebPointCollection
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
WebMultiPoint, WebPath

public abstract class WebPointCollection
extends WebGeometry

WebPointCollection is a convenience base class for geometries with multiple WebPoints such as WebMultiPoint and WebPath. You can use this as a base class to create geometries representing multiple points of your own. However, consumers of geometries are discouraged from using this class directly and should consider using the concrete implementations of this class such as WebMultiPoint and WebPath.

See Also:
Serialized Form

Field Summary
protected  List<WebPoint> points
          The List of WebPoints represented by this point collection
 
Fields inherited from class com.esri.adf.web.data.geometry.WebGeometry
spatialReference
 
Constructor Summary
WebPointCollection(List<? extends WebPoint> points)
           Creates a new WebPointCollection object with the given List of WebPoints.
WebPointCollection(WebSpatialReference spatialReference)
           Creates a new WebPointCollection in the given spatial reference.
 
Method Summary
 void addPoint(WebPoint point)
           Adds a new WebPoint to the List of WebPoints represented by this point collection.
 boolean equals(Object obj)
           
 List<WebPoint> fromMapPoints(WebExtent extent, int width, int height)
           
 List<WebPoint> fromMapPoints(WebMap webMap)
           Converts the List of map points in this collection to a List of screen points.
 List<WebPoint> getPoints()
           Returns the List of WebPoints represented by this point collection.
 double[] getXs()
          Returns an array with horizontal coordinates of all points in the WebPointCollection.
 double[] getYs()
          Returns an array with vertical coordinates of all points in the WebPointCollection.
 int hashCode()
           
protected  List<WebPoint> projectPoints(WebSpatialReference toSpatialReference)
           Converts the List of map points in this collection from the coordinate system of this geometry to the given coordinate system.
 List<WebPoint> toMapPoints(WebExtent extent, int width, int height)
           
 List<WebPoint> toMapPoints(WebMap webMap)
           Converts the List of screen points in this collection to a List of map points in the coordinate system of the given WebMap.
 String toString()
           
 
Methods inherited from class com.esri.adf.web.data.geometry.WebGeometry
fromMapGeometry, fromMapGeometry, getGeometryType, getSpatialReference, project, setSpatialReference, toMapGeometry, toMapGeometry
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

points

protected List<WebPoint> points
The List of WebPoints represented by this point collection

Constructor Detail

WebPointCollection

public WebPointCollection(List<? extends WebPoint> points)

Creates a new WebPointCollection object with the given List of WebPoints. All points must be in the same spatial reference. The spatial reference of this collection is extracted from the spatial reference of these points.

Parameters:
points - a List of WebPoints the create this collection

WebPointCollection

public WebPointCollection(WebSpatialReference spatialReference)

Creates a new WebPointCollection in the given spatial reference.

Parameters:
spatialReference - the spatial reference of the WebPointCollection created
Method Detail

getPoints

public List<WebPoint> getPoints()

Returns the List of WebPoints represented by this point collection.

Returns:
the List of WebPoints represented by this point collection

addPoint

public void addPoint(WebPoint point)

Adds a new WebPoint to the List of WebPoints represented by this point collection.

Parameters:
point - the WebPoint to be added to the List of WebPoints represented by this point collection

toMapPoints

public List<WebPoint> toMapPoints(WebMap webMap)

Converts the List of screen points in this collection to a List of map points in the coordinate system of the given WebMap. This method is typically used by the sub-classes of this class to convert the points contained by them.

Parameters:
webMap - The WebMap based on which the coordinates need to be converted
Returns:
a List of points in map coordinates

toMapPoints

public List<WebPoint> toMapPoints(WebExtent extent,
                                  int width,
                                  int height)

fromMapPoints

public List<WebPoint> fromMapPoints(WebMap webMap)

Converts the List of map points in this collection to a List of screen points. This method is typically used by the sub-classes of this class to convert the points contained by them.

Parameters:
webMap - The WebMap based on which the coordinates need to be converted
Returns:
a List of points in screen coordinates

fromMapPoints

public List<WebPoint> fromMapPoints(WebExtent extent,
                                    int width,
                                    int height)

projectPoints

protected List<WebPoint> projectPoints(WebSpatialReference toSpatialReference)

Converts the List of map points in this collection from the coordinate system of this geometry to the given coordinate system. This method is typically used by the sub-classes of this class to project the points contained by them.

Parameters:
toSpatialReference - the desired spatial reference of the projected geometry
Returns:
a List of projected points

getXs

public double[] getXs()
Returns an array with horizontal coordinates of all points in the WebPointCollection.

Returns:
an array with horizontal coordinates of all points in the WebPointCollection

getYs

public double[] getYs()
Returns an array with vertical coordinates of all points in the WebPointCollection.

Returns:
an array with vertical coordinates of all points in the WebPointCollection.

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class WebGeometry

equals

public boolean equals(Object obj)
Overrides:
equals in class WebGeometry