java sortedmap_一个关于Java中SortedMap定义的问题

一个关于Java中SortedMap定义的问题

在SortedMap接口的解释中有这么一段话:

*

Note that the ordering maintained by a sorted map (whether or not an

* explicit comparator is provided) must be consistent with equals if

* the sorted map is to correctly implement the Map interface. (See

* the Comparable interface or Comparator interface for a

* precise definition of consistent with equals.) This is so because

* the Map interface is defined in terms of the equals

* operation, but a sorted map performs all key comparisons using its

* compareTo (or compare) method, so two keys that are

* deemed equal by this method are, from the standpoint of the sorted map,

* equal. The behavior of a tree map is well-defined even if its

* ordering is inconsistent with equals; it just fails to obey the general

* contract of the Map interface.

请问这段话是什么意思?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值