Class ImmutableMultiset.Builder<E>
java.lang.Object
cloud.opencode.base.collections.immutable.ImmutableMultiset.Builder<E>
- Type Parameters:
E- element type | 元素类型
- Enclosing class:
ImmutableMultiset<E>
Builder for ImmutableMultiset
ImmutableMultiset 构建器
- Since:
- JDK 25, opencode-base-collections V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionAdd an element.final ImmutableMultiset.Builder<E> Add elements.Add multiple copies of an element.Add all elements from an iterable.build()Build the immutable multiset.Set the count for an element.
-
Method Details
-
add
Add an element. 添加元素。- Parameters:
element- the element | 元素- Returns:
- this builder | 此构建器
-
add
Add elements. 添加元素。- Parameters:
elements- the elements | 元素- Returns:
- this builder | 此构建器
-
add
Add multiple copies of an element. 添加元素的多个副本。- Parameters:
element- the element | 元素count- the number of copies to add | 要添加的副本数- Returns:
- this builder | 此构建器
-
addAll
Add all elements from an iterable. 从可迭代对象添加所有元素。- Parameters:
elements- the elements | 元素- Returns:
- this builder | 此构建器
-
setCount
Set the count for an element. 设置元素的计数。- Parameters:
element- the element | 元素count- the count | 计数- Returns:
- this builder | 此构建器
-
build
Build the immutable multiset. 构建不可变多重集。- Returns:
- immutable multiset | 不可变多重集
-