public interface SortedMap<K,V> extends Map<K,V> {
//返回比较器
Comparator<? super K> comparator();
//返回部分Map[fromKey, toKey)[Sorted有序的]
SortedMap<K,V> subMap(K fromKey, K toKey);
//返回部分Map[0, toKey)[Sorted有序的]
SortedMap<K,V> headMap(K toKey);
//返回部分Map[fromKey, )[Sorted有序的]
SortedMap<K,V> tailMap(K fromKey);
K firstKey();
K lastKey();
//支持{@code Iterator.remove}, {@code Set.remove},
{@code removeAll}, {@code retainAll}, and {@code clear}
//不支持{@code add},{@code addAll}
//修改Map会对同时在迭代的KeySet造成影响(反之也成立)[除了迭代器内部的remove方法]
[即使得迭代结果不确定,但没有明确写明会报错]
//升序
Set<K> keySet();
//支持{@code Iterator.remove}, {@code Set.remove},
{@code removeAll}, {@code retainAll}, and {@code clear}
//不支持{@code add},{@code addAll}
//修改Map会对同时在迭代的values造成影响(反之也成立)[除了迭代器内部的remove方法]
[即使得迭代结果不确定,但没有明确写明会报错]
//升序
Collection<V> values();
//支持{@code Iterator.remove}, {@code Set.remove},
{@code removeAll}, {@code retainAll}, and {@code clear}
//不支持{@code add},{@code addAll}
//修改Map会对同时在迭代的values造成影响(反之也成立)[除了迭代器内部的remove/setValue方法]
[即使得迭代结果不确定,但没有明确写明会报错]
//升序
Set<Map.Entry<K, V>> entrySet();
}
SortedMap接口
最新推荐文章于 2024-01-03 18:24:31 发布