public class

Location

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

Class Overview

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

Summary

Fields
private String address
private boolean hasCoordinates
private float latitude
private float longitude
Public Constructors
Location(String address)
Creates an address location.
Location(String address, float latitude, float longitude)
Creates a location with latitude, longitude and address.
Public Methods
void clearCoordinates()
Unset latitude and longitude..
boolean equals(Object o)
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(String address)
Sets the address.
void setLatitude(float latitude)
Sets latitude.
void setLongitude(float longitude)
Sets longitude.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private String address

private boolean hasCoordinates

private float latitude

private float longitude

Public Constructors

public Location (String address)

Creates an address location.

Parameters
address

public Location (String address, float latitude, float longitude)

Creates a location with latitude, longitude and address.

Parameters
address
latitude
longitude

Public Methods

public void clearCoordinates ()

Unset latitude and longitude..

public boolean equals (Object o)

Parameters
o

public String getAddress ()

Gets the address.

Returns
  • address or null

public float getLatitude ()

Gets latitude, if it has been defined.

Returns
  • latitude
Throws
IllegalStateException if no coordinates have been defined (check with hasCoordinates().

public float getLongitude ()

Gets the longitude, if it has been defined.

Returns
  • the longitude
Throws
IllegalStateException if no coordinates have been defined (check with hasCoordinates().

public boolean hasCoordinates ()

Check whether coordinates have been defined.

Returns
  • true if coordinates have been defined

public int hashCode ()

public void setAddress (String address)

Sets the address.

Parameters
address An address
Throws
NullPointerException if the address is null

public void setLatitude (float latitude)

Sets latitude.

Parameters
latitude

public void setLongitude (float longitude)

Sets longitude.

Parameters
longitude