Example usage for org.apache.commons.collections.map CompositeMap CompositeMap

List of usage examples for org.apache.commons.collections.map CompositeMap CompositeMap

Introduction

In this page you can find the example usage for org.apache.commons.collections.map CompositeMap CompositeMap.

Prototype

public CompositeMap(Map one, Map two, MapMutator mutator) 

Source Link

Document

Create a new CompositeMap with two composited Map instances.

Usage

From source file:org.apache.stanbol.enhancer.nlp.utils.LanguageConfiguration.java

/**
 * Returns configured parameters if <code>{@link #isLanguage(String)} == true</code>.
 * The returned map contains {@link #getLanguageParams(String) language specific parameters} 
 * merged with {@link #getDefaultParameters()}
 * @param language the language/*from  w  w  w  . ja  va 2 s  . c  o m*/
 * @return the parameters or <code>null</code> if none or the parsed language
 * is not active.
 */
public Map<String, String> getParameters(String parsedLang) {
    LangState ls = getLanguageState(parsedLang);
    if (ls.state) {
        Map<String, String> params = configuredLanguages.get(ls.lang);
        if (params != null) {
            params = new CompositeMap(params, defaultParameters, CONFIGURATION_MERGER);
        } else {
            params = defaultParameters;
        }
        return params;
    } else {
        return null; //to indicate the parsed language is not active
    }
}