Class PrefixTimeZonesMap

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable

    public class PrefixTimeZonesMap
    extends java.lang.Object
    implements java.io.Externalizable
    A utility that maps phone number prefixes to a list of strings describing the time zones to which each prefix belongs.
    See Also:
    Serialized Form
    • 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 zones number's calling country code corresponds to.
      java.util.List<java.lang.String> lookupTimeZonesForNumber​(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber number)
      As per lookupTimeZonesForNumber(long), but receives the number as a PhoneNumber instead of a long.
      void readExternal​(java.io.ObjectInput objectInput)  
      void readPrefixTimeZonesMap​(java.util.SortedMap<java.lang.Integer,​java.lang.String> sortedPrefixTimeZoneMap)
      Creates a PrefixTimeZonesMap initialized with sortedPrefixTimeZoneMap.
      java.lang.String toString()
      Dumps the mappings contained in the phone prefix 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

      • PrefixTimeZonesMap

        public PrefixTimeZonesMap()
    • Method Detail

      • readPrefixTimeZonesMap

        public void readPrefixTimeZonesMap​(java.util.SortedMap<java.lang.Integer,​java.lang.String> sortedPrefixTimeZoneMap)
        Creates a PrefixTimeZonesMap initialized with sortedPrefixTimeZoneMap. 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.IOException
        Supports Java Serialization.
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • readExternal

        public void readExternal​(java.io.ObjectInput objectInput)
                          throws java.io.IOException
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • lookupTimeZonesForNumber

        public java.util.List<java.lang.String> lookupTimeZonesForNumber​(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber number)
        As per lookupTimeZonesForNumber(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 zones number'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:
        toString in class java.lang.Object