Code example for NavigableMap

Methods: headMap

0
 
    @SuppressWarnings("unchecked") 
    private static SortedMap<String, ?> headMapInclusive(SortedMap<String, ?> map, String input) {
        // use NavigableMap inclusive version if available 
        if(map instanceof NavigableMap) {
            return ((NavigableMap)map).headMap(input, true);
        } 
        // use StoredSortedMap inclusive version if available 
        if(map instanceof StoredSortedMap) {
            return ((StoredSortedMap)map).headMap(input, true);
        } 
        // Use synthetic "one above" trick 
        // NOTE: because '\0' sorts in the middle in "java modified UTF-8", 
        // used in the Stored* class StringBindings, this trick won't work 
        // there 
        return map.headMap(input+'\0');
    } 
 
 
    private static String last(SortedMap<String,?> map) {
Stop searching for code, let great code find you!  Add Codota to your java IDE