Interface ListMultimap<K,V>
- Type Parameters:
K- key type | 键类型V- value type | 值类型
- All Superinterfaces:
Multimap<K,V>
ListMultimap - List-based Multimap Interface
ListMultimap - 基于列表的多值映射接口
A multimap that stores values in lists, preserving insertion order and allowing duplicate key-value pairs.
将值存储在列表中的多值映射,保留插入顺序并允许重复的键值对。
Features | 主要功能:
- Duplicate values per key - 每个键允许重复值
- Preserves insertion order - 保留插入顺序
- List access to values - 列表方式访问值
Usage Examples | 使用示例:
ListMultimap<String, Integer> multimap = MultimapBuilder.linkedHashKeys()
.arrayListValues()
.build();
multimap.put("a", 1);
multimap.put("a", 2);
multimap.put("a", 1); // duplicate allowed
List<Integer> values = multimap.get("a"); // [1, 2, 1]
Performance | 性能特性:
- get: O(1) - get: O(1)
- put: O(1) amortized - put: O(1) 均摊
Security | 安全性:
- Thread-safe: No (interface, implementation-dependent) - 否(接口,取决于实现)
- Null-safe: No - 否
- Since:
- JDK 25, opencode-base-collections V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Method Summary
-
Method Details
-
get
-
removeAll
-
replaceValues
-