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

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

Introduction

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

Prototype

public boolean containsKey(Object key) 

Source Link

Usage

From source file:forplay.rebind.AutoClientBundleGenerator.java

License:Apache License

/**
 * Filter file set, preferring *.mp3 files where alternatives exist.
 */// w  ww  .  jav a 2s.c om
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());
}