public class PhonePrefixMap extends Object implements Externalizable
| Constructor and Description |
|---|
PhonePrefixMap()
Creates an empty
PhonePrefixMap. |
| Modifier and Type | Method and Description |
|---|---|
String |
lookup(Phonenumber.PhoneNumber number)
As per
lookup(long), but receives the number as a PhoneNumber instead of a long. |
void |
readExternal(ObjectInput objectInput)
Supports Java Serialization.
|
void |
readPhonePrefixMap(SortedMap<Integer,String> sortedPhonePrefixMap)
Creates an
PhonePrefixMap initialized with sortedPhonePrefixMap. |
String |
toString()
Dumps the mappings contained in the phone prefix map.
|
void |
writeExternal(ObjectOutput objectOutput)
Supports Java Serialization.
|
public PhonePrefixMap()
PhonePrefixMap. The default constructor is necessary for implementing
Externalizable. The empty map could later be populated by
readPhonePrefixMap(java.util.SortedMap) or readExternal(java.io.ObjectInput).public void readPhonePrefixMap(SortedMap<Integer,String> sortedPhonePrefixMap)
PhonePrefixMap initialized with sortedPhonePrefixMap. Note that the
underlying implementation of this method is expensive thus should not be called by
time-critical applications.sortedPhonePrefixMap - a map from phone number prefixes to descriptions of those prefixes
sorted in ascending order of the phone number prefixes as integers.public void readExternal(ObjectInput objectInput) throws IOException
readExternal in interface ExternalizableIOExceptionpublic void writeExternal(ObjectOutput objectOutput) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic String lookup(Phonenumber.PhoneNumber number)
lookup(long), but receives the number as a PhoneNumber instead of a long.number - the phone number to look upCopyright © 2014 Google. All Rights Reserved.