com.google.i18n.phonenumbers.geocoding
Class PhoneNumberOfflineGeocoder

java.lang.Object
  extended by com.google.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder

public class PhoneNumberOfflineGeocoder
extends java.lang.Object

An offline geocoder which provides geographical information related to a phone number.

Author:
Shaopeng Jia

Method Summary
 java.lang.String getDescriptionForNumber(Phonenumber.PhoneNumber number, java.util.Locale languageCode)
          Returns a text description for the given language code for the given phone number.
 java.lang.String getDescriptionForValidNumber(Phonenumber.PhoneNumber number, java.util.Locale languageCode)
          Returns a text description for the given language code for the given phone number.
static PhoneNumberOfflineGeocoder getInstance()
          Gets a PhoneNumberOfflineGeocoder instance to carry out international phone number geocoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static PhoneNumberOfflineGeocoder getInstance()
Gets a PhoneNumberOfflineGeocoder instance to carry out international phone number geocoding.

The PhoneNumberOfflineGeocoder is implemented as a singleton. Therefore, calling this method multiple times will only result in one instance being created.

Returns:
a PhoneNumberOfflineGeocoder instance

getDescriptionForValidNumber

public java.lang.String getDescriptionForValidNumber(Phonenumber.PhoneNumber number,
                                                     java.util.Locale languageCode)
Returns a text description for the given language code for the given phone number. The description might consist of the name of the country where the phone number is from and/or the name of the geographical area the phone number is from. This method assumes the validity of the number passed in has already been checked.

Parameters:
number - a valid phone number for which we want to get a text description
languageCode - the language code for which the description should be written
Returns:
a text description for the given language code for the given phone number

getDescriptionForNumber

public java.lang.String getDescriptionForNumber(Phonenumber.PhoneNumber number,
                                                java.util.Locale languageCode)
Returns a text description for the given language code for the given phone number. The description might consist of the name of the country where the phone number is from and/or the name of the geographical area the phone number is from. This method explictly checkes the validity of the number passed in.

Parameters:
number - the phone number for which we want to get a text description
languageCode - the language code for which the description should be written
Returns:
a text description for the given language code for the given phone number, or empty string if the number passed in is invalid


Copyright © 2011 Google. All Rights Reserved.