【开源中国 APP 全新上线】“动弹” 回归、集成大模型对话、畅读技术报告”
google Guava包中的Table集合接口木有 remove(Object rowKey) 或 remove(Object columnKey) 方法。
只有一个remove(Object rowKey, Object columnKey)方法,真是坑啊。
google的文档说Table的产生主要是解决像 Map<FirstName, Map<LastName, Person>>这样的问题。可是没有remove(Object key)方法,这是明显的缺陷。
Typically, when you are trying to index on more than one key at a time, you will wind up with something like Map<FirstName, Map<LastName, Person>>, which is ugly and awkward to use. Guava provides a new collection type, Table, which supports this use case for any "row" type and "column" type. Table supports a number of views to let you use the data from any angle谁能帮忙曲线解决这一问题?
测试了下,报错。查看API发现在迭代中不支持使用remove().这次无语了。
Iterator<E>.remove()