Code example for HashMap

Methods: get, size

0
    	for(DictionaryAddOnAndBuilder addOn : newAddOns)
    		mBuildersByLocale.put(addOn.getLanguage(), addOn);
    } 
     
    public synchronized DictionaryAddOnAndBuilder getAddOnByLocale(String locale, Context askContext) {
    	if (mBuildersByLocale.size() == 0)
    		loadAddOns(askContext);
    	 
    	return mBuildersByLocale.get(locale);
    } 
 
	@Override 
	protected DictionaryAddOnAndBuilder createConcreateAddOn(Context askContext, Context context,
			String prefId, int nameId, String description, int sortIndex,
			AttributeSet attrs) {
		 
		final String language = attrs.getAttributeValue(null, XML_LANGUAGE_ATTRIBUTE);
		final String assets = attrs.getAttributeValue(null, XML_ASSETS_ATTRIBUTE);
		final int dictionaryResourceId = attrs.getAttributeResourceValue(null, XML_RESOURCE_ATTRIBUTE, AddOn.INVALID_RES_ID);
		final int autoTextResId = attrs.getAttributeResourceValue(null, XML_AUTO_TEXT_RESOURCE_ATTRIBUTE, AddOn.INVALID_RES_ID);
		final int initialSuggestionsId = attrs.getAttributeResourceValue(null, XML_INITIAL_SUGGESTIONS_ARRAY_RESOURCE_ATTRIBUTE, AddOn.INVALID_RES_ID);