# Google Data APIs Client Library (1.43.0)

## com.google.api.gbase.client
Class Location

    java.lang.Object
      com.google.api.gbase.client.Location

    public class Location

extends java.lang.Object

Object representation of a location; an address and optionally latitude and longitude.

Constructor Summary
`Location(java.lang.String address)` Creates an address location.
`Location(java.lang.String address, float latitude, float longitude)` Creates a location with latitude, longitude and address.

Method Summary
`void` `clearCoordinates()` Unset latitude and longitude..
`boolean` `equals(java.lang.Object o)`
`java.lang.String` `getAddress()` Gets the address.
`float` `getLatitude()` Gets latitude, if it has been defined.
`float` `getLongitude()` Gets the longitude, if it has been defined.
`boolean` `hasCoordinates()` Check whether coordinates have been defined.
`int` `hashCode()`
`void` `setAddress(java.lang.String address)` Sets the address.
`void` `setLatitude(float latitude)` Sets latitude.
`void` `setLongitude(float longitude)` Sets longitude.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Location

    public Location(java.lang.String address)

  Creates an address location.

  Parameters:
    `address` -

### Location

    public Location(java.lang.String address,
                    float latitude,
                    float longitude)

  Creates a location with latitude, longitude and address.

  Parameters:
    `address` -
    `latitude` -
    `longitude` -

Method Detail

### hasCoordinates

    public boolean hasCoordinates()

  Check whether coordinates have been defined.

  Returns:
    true if coordinates have been defined

### clearCoordinates

    public void clearCoordinates()

  Unset latitude and longitude..

### getLatitude

    public float getLatitude()

  Gets latitude, if it has been defined.

  Returns:
    latitude
  Throws:
    `java.lang.IllegalStateException` - if no coordinates have been defined (check with `hasCoordinates()`.

### getLongitude

    public float getLongitude()

  Gets the longitude, if it has been defined.

  Returns:
    the longitude
  Throws:
    `java.lang.IllegalStateException` - if no coordinates have been defined (check with `hasCoordinates()`.

### setLongitude

    public void setLongitude(float longitude)

  Sets longitude.

  Parameters:
    `longitude` -

### setLatitude

    public void setLatitude(float latitude)

  Sets latitude.

  Parameters:
    `latitude` -

### getAddress

    public java.lang.String getAddress()

  Gets the address.

  Returns:
    address or null

### setAddress

    public void setAddress(java.lang.String address)

  Sets the address.

  Parameters:
    `address` - an address
  Throws:
    `java.lang.NullPointerException` - if the address is null

### equals

    public boolean equals(java.lang.Object o)

  Overrides:
    `equals` in class `java.lang.Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `java.lang.Object`