Class PrefixTimeZonesMap
java.lang.Object
com.google.i18n.phonenumbers.prefixmapper.PrefixTimeZonesMap
- All Implemented Interfaces:
Externalizable,Serializable
A utility that maps phone number prefixes to a list of strings describing the time zones to
which each prefix belongs.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the list of time zonesnumber's calling country code corresponds to.As perlookupTimeZonesForNumber(long), but receives the number as a PhoneNumber instead of a long.voidreadExternal(ObjectInput objectInput) voidreadPrefixTimeZonesMap(SortedMap<Integer, String> sortedPrefixTimeZoneMap) Creates aPrefixTimeZonesMapinitialized withsortedPrefixTimeZoneMap.toString()Dumps the mappings contained in the phone prefix map.voidwriteExternal(ObjectOutput objectOutput) Supports Java Serialization.
-
Constructor Details
-
PrefixTimeZonesMap
public PrefixTimeZonesMap()
-
-
Method Details
-
readPrefixTimeZonesMap
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
Supports Java Serialization.- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
lookupTimeZonesForNumber
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
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
Dumps the mappings contained in the phone prefix map.
-