Example usage for org.apache.commons.collections4 Trie put

List of usage examples for org.apache.commons.collections4 Trie put

Introduction

In this page you can find the example usage for org.apache.commons.collections4 Trie put.

Prototype

V put(K key, V value);

Source Link

Document

Associates the specified value with the specified key in this map (optional operation).

Usage

From source file:cherry.foundation.telno.AreaCodeTableFactory.java

/**
 *  ( (6?)??????) ??//from   w  w  w .  ja  v  a  2  s. co  m
 * 
 * @return  ( (6?)??????)
 * @throws InvalidFormatException ????
 * @throws IOException ??
 */
@Override
public Trie<String, Integer> getObject() throws InvalidFormatException, IOException {
    Trie<String, Integer> trie = new PatriciaTrie<>();
    for (Resource r : resources) {
        try (InputStream in = r.getInputStream()) {
            Map<String, Pair<String, String>> map = soumuExcelParser.parse(in);
            for (Map.Entry<String, Pair<String, String>> entry : map.entrySet()) {
                trie.put(entry.getKey(), entry.getValue().getLeft().length());
            }
        }
    }
    return trie;
}