public interface IndexedElementHelper<E>
该接口用于避免集合的中元素直接实现
IndexedElement,以避免暴露不必要的接口- 作者:
- wjybxx date - 2024/8/5
-
字段概要
字段 -
方法概要
修饰符和类型方法说明intcollectionIndex(Object collection, E element) 获取对象在集合中的索引voidcollectionIndex(Object collection, E element, int index) 设置其在集合中的索引
-
字段详细资料
-
INDEX_NOT_FOUND
static final int INDEX_NOT_FOUND注意:未插入的节点的所以必须初始化为该值- 另请参阅:
-
-
方法详细资料
-
collectionIndex
获取对象在集合中的索引- 参数:
collection- 考虑到一个元素可能在多个队列中,因此传入队列引用
-
collectionIndex
设置其在集合中的索引- 参数:
index- 如果是删除元素,则索引为-1
-