简体   繁体   English

代表清单 <E> 作为SortedMap <Integer,E> 在Java中?

[英]Represent List<E> as SortedMap<Integer,E> in Java?

Is there any wrapper in popular collection libraries, which implements wrapper for List<E> so that it can be accessed both with List<E> and SortedMap<Integer,E> interfaces? 流行的集合库中是否有包装器,该包装器实现了List<E>包装器,以便可以通过List<E>SortedMap<Integer,E>接口访问它?

The goal is to have indexes shifted on insert operation and autogenerated on add operation 目标是使索引在插入操作时转移并在添加操作时自动生成

据我所知, ArrayListLinkedList提供了以下功能:追加(您在add操作上自动生成的意思)显然是可能的,并且在执行add(int index, E element)时索引会发生移动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM