コード例 #1
0
 public override void readFromSortedMap(SortedMap<Integer, String> sortedAreaCodeMap)
 {
     numOfEntries = sortedAreaCodeMap.size();
     phoneNumberPrefixes = new int[numOfEntries];
     descriptions = new String[numOfEntries];
     int index = 0;
     foreach (int prefix in sortedAreaCodeMap.keySet()) {
       phoneNumberPrefixes[index++] = prefix;
       possibleLengths.add((int) Math.log10(prefix) + 1);
     }
     sortedAreaCodeMap.values().toArray(descriptions);
 }
コード例 #2
0
        /**
         * Initializes an {@link MappingFileProvider} with {@code availableDataFiles}.
         *
         * @param 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.
         */
        public void readFileConfigs(SortedMap <Integer, Set <String> > availableDataFiles)
        {
            numOfEntries        = availableDataFiles.size();
            countryCallingCodes = new int[numOfEntries];
            availableLanguages  = new ArrayList <Set <String> >(numOfEntries);
            int index = 0;

            foreach (int countryCallingCode in availableDataFiles.keySet())
            {
                countryCallingCodes[index++] = countryCallingCode;
                availableLanguages.add(new HashSet <String>(availableDataFiles.get(countryCallingCode)));
            }
        }
コード例 #3
0
        public void readFromSortedMap(SortedMap <Integer, String> sortedAreaCodeMap)
        {
            numOfEntries        = sortedAreaCodeMap.size();
            phoneNumberPrefixes = new int[numOfEntries];
            descriptions        = new String[numOfEntries];
            int index = 0;

            foreach (int prefix in sortedAreaCodeMap.keySet())
            {
                phoneNumberPrefixes[index++] = prefix;
                possibleLengths.add((int)Math.log10(prefix) + 1);
            }
            sortedAreaCodeMap.values().toArray(descriptions);
        }
コード例 #4
0
ファイル: TreeSet.cs プロジェクト: jacobraj/MAMA
		private TreeSet(SortedMap m)
		{
			mSortedMap = m;
			mKeySet = m.keySet();
		}
コード例 #5
0
 /**
    * Initializes an {@link MappingFileProvider} with {@code availableDataFiles}.
    *
    * @param 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.
    */
 public void readFileConfigs(SortedMap<Integer, Set<String>> availableDataFiles)
 {
     numOfEntries = availableDataFiles.size();
     countryCallingCodes = new int[numOfEntries];
     availableLanguages = new ArrayList<Set<String>>(numOfEntries);
     int index = 0;
     foreach (int countryCallingCode in availableDataFiles.keySet()) {
       countryCallingCodes[index++] = countryCallingCode;
       availableLanguages.add(new HashSet<String>(availableDataFiles.get(countryCallingCode)));
     }
 }
コード例 #6
0
ファイル: TreeSet.cs プロジェクト: vitya-maleyev/OpenMAMA
 private TreeSet(SortedMap m)
 {
     mSortedMap = m;
     mKeySet    = m.keySet();
 }