com.google.i18n.phonenumbers.geocoding
Class AreaCodeMap

java.lang.Object
  extended by com.google.i18n.phonenumbers.geocoding.AreaCodeMap
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class AreaCodeMap
extends java.lang.Object
implements java.io.Externalizable

A utility that maps phone number prefixes to a string describing the geographical area the prefix covers.

Author:
Shaopeng Jia
See Also:
Serialized Form

Constructor Summary
AreaCodeMap()
          Creates an empty AreaCodeMap.
 
Method Summary
 void readAreaCodeMap(java.util.SortedMap<java.lang.Integer,java.lang.String> sortedAreaCodeMap)
          Creates an AreaCodeMap initialized with sortedAreaCodeMap.
 void readExternal(java.io.ObjectInput objectInput)
          Supports Java Serialization.
 java.lang.String toString()
          Dumps the mappings contained in the area code map.
 void writeExternal(java.io.ObjectOutput objectOutput)
          Supports Java Serialization.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AreaCodeMap

public AreaCodeMap()
Creates an empty AreaCodeMap. The default constructor is necessary for implementing Externalizable. The empty map could later be populated by readAreaCodeMap(java.util.SortedMap) or readExternal(java.io.ObjectInput).

Method Detail

readAreaCodeMap

public void readAreaCodeMap(java.util.SortedMap<java.lang.Integer,java.lang.String> sortedAreaCodeMap)
Creates an AreaCodeMap initialized with sortedAreaCodeMap. Note that the underlying implementation of this method is expensive thus should not be called by time-critical applications.

Parameters:
sortedAreaCodeMap - a map from phone number prefixes to descriptions of corresponding geographical areas, sorted in ascending order of the phone number prefixes as integers.

readExternal

public void readExternal(java.io.ObjectInput objectInput)
                  throws java.io.IOException
Supports Java Serialization.

Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException

writeExternal

public void writeExternal(java.io.ObjectOutput objectOutput)
                   throws java.io.IOException
Supports Java Serialization.

Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

toString

public java.lang.String toString()
Dumps the mappings contained in the area code map.

Overrides:
toString in class java.lang.Object


Copyright © 2011 Google. All Rights Reserved.