Class PrefixTimeZonesMap
- java.lang.Object
-
- com.google.i18n.phonenumbers.prefixmapper.PrefixTimeZonesMap
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable
public class PrefixTimeZonesMap extends java.lang.Object implements java.io.ExternalizableA utility that maps phone number prefixes to a list of strings describing the time zones to which each prefix belongs.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PrefixTimeZonesMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>lookupCountryLevelTimeZonesForNumber(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber number)Returns the list of time zonesnumber's calling country code corresponds to.java.util.List<java.lang.String>lookupTimeZonesForNumber(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber number)As perlookupTimeZonesForNumber(long), but receives the number as a PhoneNumber instead of a long.voidreadExternal(java.io.ObjectInput objectInput)voidreadPrefixTimeZonesMap(java.util.SortedMap<java.lang.Integer,java.lang.String> sortedPrefixTimeZoneMap)Creates aPrefixTimeZonesMapinitialized withsortedPrefixTimeZoneMap.java.lang.StringtoString()Dumps the mappings contained in the phone prefix map.voidwriteExternal(java.io.ObjectOutput objectOutput)Supports Java Serialization.
-
-
-
Method Detail
-
readPrefixTimeZonesMap
public void readPrefixTimeZonesMap(java.util.SortedMap<java.lang.Integer,java.lang.String> sortedPrefixTimeZoneMap)
Creates aPrefixTimeZonesMapinitialized withsortedPrefixTimeZoneMap. Note that the underlying implementation of this method is expensive thus should not be called by time-critical applications.- Parameters:
sortedPrefixTimeZoneMap- a map from phone number prefixes to their corresponding time zones, sorted in ascending order of the phone number prefixes as integers.
-
writeExternal
public void writeExternal(java.io.ObjectOutput objectOutput) throws java.io.IOExceptionSupports Java Serialization.- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput objectInput) throws java.io.IOException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
lookupTimeZonesForNumber
public java.util.List<java.lang.String> lookupTimeZonesForNumber(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber number)
As perlookupTimeZonesForNumber(long), but receives the number as a PhoneNumber instead of a long.- Parameters:
number- the phone number to look up- Returns:
- the list of corresponding time zones
-
lookupCountryLevelTimeZonesForNumber
public java.util.List<java.lang.String> lookupCountryLevelTimeZonesForNumber(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber number)
Returns the list of time zonesnumber's calling country code corresponds to.- Parameters:
number- the phone number to look up- Returns:
- the list of corresponding time zones
-
toString
public java.lang.String toString()
Dumps the mappings contained in the phone prefix map.- Overrides:
toStringin classjava.lang.Object
-
-