Returns a map containing all the entries in the map that match the given name. If case-sensitive, that map will have 0 or 1 elements; if case-insensitive, it may have 0 or more.
(String name, boolean caseSensitive)
| 74 | * name. If case-sensitive, that map will have 0 or 1 elements; if |
| 75 | * case-insensitive, it may have 0 or more. */ |
| 76 | public NavigableMap<String, V> range(String name, boolean caseSensitive) { |
| 77 | Object floorKey; |
| 78 | Object ceilingKey; |
| 79 | if (caseSensitive) { |
| 80 | floorKey = name; |
| 81 | ceilingKey = name; |
| 82 | } else { |
| 83 | floorKey = COMPARATOR.floorKey(name); |
| 84 | ceilingKey = COMPARATOR.ceilingKey(name); |
| 85 | } |
| 86 | NavigableMap subMap = ((NavigableMap) map).subMap(floorKey, true, ceilingKey, true); |
| 87 | return Collections.unmodifiableNavigableMap((NavigableMap<String, V>) subMap); |
| 88 | } |
| 89 | |
| 90 | /** Returns whether this map contains a given key, with a given |
| 91 | * case-sensitivity. */ |