List of usage examples for java.util TreeMap TreeMap
public TreeMap(SortedMap<K, ? extends V> m)
From source file:edu.umd.cfar.lamp.viper.util.Range.java
/** * Creates a new, empty Range. * @param c The comparison to use while adding items to the range. */ public Range(Comparator c) { spans = new TreeMap(c); }
From source file:com.scraper.SignedRequestsHelper.java
public String sign(Map<String, String> params) { params.put("AWSAccessKeyId", awsAccessKeyId); params.put("Timestamp", timestamp()); params.put("AssociateTag", AssociateTag); SortedMap<String, String> sortedParamMap = new TreeMap<String, String>(params); String canonicalQS = canonicalize(sortedParamMap); String toSign = REQUEST_METHOD + "\n" + endpoint + "\n" + REQUEST_URI + "\n" + canonicalQS; String hmac = hmac(toSign);/*from w w w.j a v a 2 s. co m*/ String sig = percentEncodeRfc3986(hmac); String url = "http://" + endpoint + REQUEST_URI + "?" + canonicalQS + "&Signature=" + sig; return url; }