Class MappingFileProvider
- java.lang.Object
-
- com.google.i18n.phonenumbers.prefixmapper.MappingFileProvider
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable
public class MappingFileProvider extends java.lang.Object implements java.io.ExternalizableA 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
-
-
Constructor Summary
Constructors Constructor Description MappingFileProvider()Creates an emptyMappingFileProvider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidreadExternal(java.io.ObjectInput objectInput)Supports Java Serialization.voidreadFileConfigs(java.util.SortedMap<java.lang.Integer,java.util.Set<java.lang.String>> availableDataFiles)Initializes anMappingFileProviderwithavailableDataFiles.java.lang.StringtoString()Returns a string representing the data in this class.voidwriteExternal(java.io.ObjectOutput objectOutput)Supports Java Serialization.
-
-
-
Constructor Detail
-
MappingFileProvider
public MappingFileProvider()
Creates an emptyMappingFileProvider. The default constructor is necessary for implementingExternalizable. The empty provider could later be populated byreadFileConfigs(java.util.SortedMap)orreadExternal(java.io.ObjectInput).
-
-
Method Detail
-
readFileConfigs
public void readFileConfigs(java.util.SortedMap<java.lang.Integer,java.util.Set<java.lang.String>> availableDataFiles)
Initializes anMappingFileProviderwithavailableDataFiles.- 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.IOExceptionSupports Java Serialization.- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
writeExternal
public void writeExternal(java.io.ObjectOutput objectOutput) throws java.io.IOExceptionSupports Java Serialization.- Specified by:
writeExternalin interfacejava.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:
toStringin classjava.lang.Object
-
-