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); }
/** * 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))); } }
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); }
private TreeSet(SortedMap m) { mSortedMap = m; mKeySet = m.keySet(); }
/** * 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))); } }