public interface NavigableMap<K,V> extends SortedMap<K,V> {
// 返回键小于指定 key 的第一个元素(Map.Entry),如果不存在则返回 null。
Map.Entry<K,V> lowerEntry(K key);
// 返回键小于指定 key 的第一个键,如果不存在则返回 null。
K lowerKey(K key);
// 返回键小于等于指定 key 的第一个元素(Map.Entry),如果不存在则返回 null。
Map.Entry<K,V> floorEntry(K key);
// 返回键小于等于指定 key 的第一个键,如果不存在则返回 null。
K floorKey(K key);
// 返回键大于等于指定 key 的第一个元素(Map.Entry),如果不存在则返回 null。
Map.Entry<K,V> ceilingEntry(K key);
// 返回键大于等于指定 key 的第一个键,如果不存在则返回 null。
K ceilingKey(K key);
// 返回键大于指定 key 的第一个元素(Map.Entry),如果不存在则返回 null。
Map.Entry<K,V> higherEntry(K key);
// 返回键大于指定 key 的第一个键,如果不存在则返回 null。
K higherKey(K key);
// 返回集合中的第一个元素(Map.Entry),如果不存在则返回 null。
Map.Entry<K,V> firstEntry();
// 返回集合中的最后一个元素(Map.Entry),如果不存在则返回 null。
Map.Entry<K,V> lastEntry();
// 返回并移除集合中的第一个元素(Map.Entry),如果不存在则返回 null。
Map.Entry<K,V> pollFirstEntry();
// 返回并移除集合中的最后一个元素(Map.Entry),如果不存在则返回 null。
Map.Entry<K,V> pollLastEntry();
// 返回此映射的逆序视图。
NavigableMap<K,V> descendingMap();
// 返回此映射中键的逆序视图。
NavigableSet<K> navigableKeySet();
// 返回此映射中键的逆序视图(NavigableSet)。
NavigableSet<K> descendingKeySet();
// 返回此映射的部分视图,其键的范围从 fromKey 到 toKey。
// 如果 fromInclusive 为 true,则包含 fromKey;如果 toInclusive 为 true,则包含 toKey。
NavigableMap<K,V> subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive);
// 返回此映射的部分视图,其键小于(或等于,如果 inclusive 为 true)给定的 toKey。
NavigableMap<K,V> headMap(K toKey, boolean inclusive);
// 返回此映射的部分视图,其键大于(或等于,如果 inclusive 为 true)给定的 fromKey。
NavigableMap<K,V> tailMap(K fromKey, boolean inclusive);
// 返回此映射的部分视图,其键的范围从 fromKey 到 toKey。
// 注意:这些方法返回的是 SortedMap,而非 NavigableMap,因此不提供导航功能。
SortedMap<K,V> subMap(K fromKey, K toKey);
SortedMap<K,V> headMap(K toKey);
SortedMap<K,V> tailMap(K fromKey);
}