Java SortedMap Usage filterPrefix( SortedMap baseMap, String prefix)

Here you can find the source of filterPrefix( SortedMap baseMap, String prefix)

Description

filter Prefix

License

Open Source License

Declaration

private static <V> SortedMap<String, V> filterPrefix(
            SortedMap<String, V> baseMap, String prefix) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.SortedMap;

public class Main {
    private static <V> SortedMap<String, V> filterPrefix(
            SortedMap<String, V> baseMap, String prefix) {
        if (prefix.length() > 0) {
            char nextLetter = (char) (prefix.charAt(prefix.length() - 1) + 1);
            String end = prefix.substring(0, prefix.length() - 1)
                    + nextLetter;// ww w.  jav a2s.  c om
            return baseMap.subMap(prefix, end);
        }
        return baseMap;
    }
}

Related

  1. computeByteSizeM( SortedMap byteSizeByName)
  2. computePathCauselessLms( List>> depCausesByNameList)
  3. find(SortedMap map, String baseName)
  4. firstElement(Collection c)
  5. firstElement(Collection c)
  6. generatePropertiesFilter(SortedMap propertiesMap)