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
-
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.void
readExternal
(ObjectInput objectInput) void
readPrefixTimeZonesMap
(SortedMap<Integer, String> sortedPrefixTimeZoneMap) Creates aPrefixTimeZonesMap
initialized withsortedPrefixTimeZoneMap
.toString()
Dumps the mappings contained in the phone prefix map.void
writeExternal
(ObjectOutput objectOutput) Supports Java Serialization.
-
Constructor Details
-
PrefixTimeZonesMap
public PrefixTimeZonesMap()
-
-
Method Details
-
readPrefixTimeZonesMap
Creates aPrefixTimeZonesMap
initialized 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:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in 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.
-