Example usage for com.google.gwt.dev.util.collect HashMap put

List of usage examples for com.google.gwt.dev.util.collect HashMap put

Introduction

In this page you can find the example usage for com.google.gwt.dev.util.collect HashMap put.

Prototype

@SuppressWarnings("unchecked")
    public V put(K key, V value) 

Source Link

Usage

From source file:forplay.rebind.AutoClientBundleGenerator.java

License:Apache License

/**
 * Filter file set, preferring *.mp3 files where alternatives exist.
 */// w w  w .  j a va  2 s.  co m
private HashSet<File> preferMp3(Set<File> files) {
    HashMap<String, File> map = new HashMap<String, File>();
    for (File file : files) {
        String path = stripExtension(file.getPath());
        if (file.getName().endsWith(".mp3") || !map.containsKey(path)) {
            map.put(path, file);
        }
    }
    return new HashSet<File>(map.values());
}