public abstract class

PointConstruct

extends ValueConstruct
implements Point
java.lang.Object
   ↳ com.google.gdata.data.AbstractExtension
     ↳ com.google.gdata.data.ValueConstruct
       ↳ com.google.gdata.data.geo.impl.PointConstruct
Known Direct Subclasses

Class Overview

A basic point construct consists of a space-separated coordinate in geo space. The namespace and name of the element are supplied by subclasses.

Summary

Fields
private Double lat
private Double lon
[Expand]
Inherited Fields
From class com.google.gdata.data.ValueConstruct
From class com.google.gdata.data.AbstractExtension
Public Constructors
PointConstruct(XmlNamespace namespace, String name)
Constructor to create an empty point object.
PointConstruct(XmlNamespace namespace, String name, Double lat, Double lon)
Constructor to create a point from a given lat/lon pair.
PointConstruct(XmlNamespace namespace, String name, Point copyFrom)
Copy constructor to create a point from another point.
Public Methods
Double getLatitude()
Double getLongitude()
void setGeoLocation(Double lat, Double lon)
Sets the latitude and longitude coordinates of this Point.
void setValue(String v)
Sets the value.
String toString()
Protected Methods
void validate()
Checks the attributes to see if there are any problems.
[Expand]
Inherited Methods
From class com.google.gdata.data.ValueConstruct
From class com.google.gdata.data.AbstractExtension
From class java.lang.Object
From interface com.google.gdata.data.Extension
From interface com.google.gdata.data.geo.Point

Fields

private Double lat

private Double lon

Public Constructors

public PointConstruct (XmlNamespace namespace, String name)

Constructor to create an empty point object.

Parameters
namespace
name

public PointConstruct (XmlNamespace namespace, String name, Double lat, Double lon)

Constructor to create a point from a given lat/lon pair. Will create an empy point if both values are null, if only one value is null with throw an illegal argument exception.

Parameters
namespace
name
lat
lon

public PointConstruct (XmlNamespace namespace, String name, Point copyFrom)

Copy constructor to create a point from another point.

Parameters
namespace
name
copyFrom

Public Methods

public Double getLatitude ()

public Double getLongitude ()

public void setGeoLocation (Double lat, Double lon)

Sets the latitude and longitude coordinates of this Point. Either both lat and lon must be non-null, or both must be null. Implementations will throw an IllegalArgumentException if only one is null and one is not. They will also throw an IllegalArgumentException if either of the lat values is outside the valid range.

Parameters
lat The latitude in degrees, from -90 to 90.
lon The longitude in degrees, from -180 to 180.

public void setValue (String v)

Sets the value. Subclasses can override this method to do additional validation of the value.

Parameters
v New value for the value construct or null to reset.

public String toString ()

Protected Methods

protected void validate ()

Checks the attributes to see if there are any problems. Default implementation does nothing, though generally this is discouraged unless there really are no restrictions.

Throws
IllegalStateException