Class MappingFileProvider

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

    public class MappingFileProvider
    extends java.lang.Object
    implements java.io.Externalizable
    A utility which knows the data files that are available for the phone prefix mappers to use. The data files contain mappings from phone number prefixes to text descriptions, and are organized by country calling code and language that the text descriptions are in.
    Author:
    Shaopeng Jia
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void readExternal​(java.io.ObjectInput objectInput)
      Supports Java Serialization.
      void readFileConfigs​(java.util.SortedMap<java.lang.Integer,​java.util.Set<java.lang.String>> availableDataFiles)
      Initializes an MappingFileProvider with availableDataFiles.
      java.lang.String toString()
      Returns a string representing the data in this class.
      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
    • Method Detail

      • readFileConfigs

        public void readFileConfigs​(java.util.SortedMap<java.lang.Integer,​java.util.Set<java.lang.String>> availableDataFiles)
        Initializes an MappingFileProvider with availableDataFiles.
        Parameters:
        availableDataFiles - a map from country calling codes to sets of languages in which data files are available for the specific country calling code. The map is sorted in ascending order of the country calling codes as integers.
      • readExternal

        public void readExternal​(java.io.ObjectInput objectInput)
                          throws java.io.IOException
        Supports Java Serialization.
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • 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
      • toString

        public java.lang.String toString()
        Returns a string representing the data in this class. The string contains one line for each country calling code. The country calling code is followed by a '|' and then a list of comma-separated languages sorted in ascending order.
        Overrides:
        toString in class java.lang.Object