Google Data APIs Client Library (1.41.1)



com.google.gdata.data.geo
Class GeoLong

java.lang.Object
  extended by com.google.gdata.data.AbstractExtension
      extended by com.google.gdata.data.ValueConstruct
          extended by com.google.gdata.data.geo.GeoLong
All Implemented Interfaces:
Extension

public class GeoLong
extends ValueConstruct

Extension for a W3C geo:long element. It contains the getter/setter for specifying the longitude of a geo-coordinate. The coordinate is contained within the long element as: <geo:long>coordinate</geo:long>. Note that the longitude element does not need to be a child of the geo:Point element. Please see the W3C document http://www.w3.org/2003/01/geo for more information.

See Also:
W3CPoint

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gdata.data.AbstractExtension
AbstractExtension.AttributesHandler
 
Field Summary
static int COORDINATE_PRECISION
          This denotes the number of significant digits after the decimal point for a coordinate when represented by a string.
static double MAX_LONG
          The maximmum acceptable value of a longitude coordinate in degrees.
static double MIN_LONG
          The minimum acceptable value of a longitude coordinate in degrees.
 
Fields inherited from class com.google.gdata.data.ValueConstruct
attrName
 
Fields inherited from class com.google.gdata.data.AbstractExtension
localName, namespace
 
Constructor Summary
GeoLong()
          Creates an instance of the GeoLong extension without a longitude value set.
GeoLong(java.lang.Double lon)
          Creates an immutable instance of GeoLong extension with the coordinate set to the value passed in.
 
Method Summary
 java.lang.Double getLongitude()
          Returns the actual double coordinate for longitude.
 void setLongitude(java.lang.Double longitude)
          Sets the longitude represented by this element.
 void setValue(java.lang.String value)
          Overrides base implementation by validating that the string represents a longitude coordinate between -180 and 180 degrees.
 
Methods inherited from class com.google.gdata.data.ValueConstruct
consumeAttributes, equals, generate, getHandler, getValue, hashCode, hasValue, isRequired, putAttributes, setRequired
 
Methods inherited from class com.google.gdata.data.AbstractExtension
disableStrictValidation, enableStrictValidation, eq, generate, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, isStrictValidation, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_LONG

public static final double MAX_LONG
The maximmum acceptable value of a longitude coordinate in degrees.

See Also:
Constant Field Values

MIN_LONG

public static final double MIN_LONG
The minimum acceptable value of a longitude coordinate in degrees.

See Also:
Constant Field Values

COORDINATE_PRECISION

public static final int COORDINATE_PRECISION
This denotes the number of significant digits after the decimal point for a coordinate when represented by a string.

See Also:
Constant Field Values
Constructor Detail

GeoLong

public GeoLong()
Creates an instance of the GeoLong extension without a longitude value set.


GeoLong

public GeoLong(java.lang.Double lon)
        throws java.lang.IllegalArgumentException
Creates an immutable instance of GeoLong extension with the coordinate set to the value passed in.

Parameters:
lon - The longitude coordinate reprensented by this element.
Throws:
java.lang.IllegalArgumentException - if the longitude is not between -180 and 180 degrees.
Method Detail

getLongitude

public java.lang.Double getLongitude()
Returns the actual double coordinate for longitude. Note this value is not rounded unlike the value returned by getValue().

Returns:
the longitude represented by this element.

setLongitude

public void setLongitude(java.lang.Double longitude)
Sets the longitude represented by this element.

Parameters:
longitude - the longitude of this element.

setValue

public void setValue(java.lang.String value)
Overrides base implementation by validating that the string represents a longitude coordinate between -180 and 180 degrees. Also formats the the string so that it has a consistent number of significant digits after the decimal point.

Overrides:
setValue in class ValueConstruct
Parameters:
value - new value for the value construct or null to reset.