Class ImmutableRangeMap.Builder<K extends Comparable<? super K>, V>

java.lang.Object
cloud.opencode.base.collections.immutable.ImmutableRangeMap.Builder<K,V>
Type Parameters:
K - endpoint type | 端点类型
V - value type | 值类型
Enclosing class:
ImmutableRangeMap<K extends Comparable<? super K>, V>

public static final class ImmutableRangeMap.Builder<K extends Comparable<? super K>, V> extends Object
Builder for ImmutableRangeMap. ImmutableRangeMap 的构建器。

Uses a TreeRangeMap internally for range management.

内部使用 TreeRangeMap 进行范围管理。

Since:
JDK 25, opencode-base-collections V1.0.3
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • put

      public ImmutableRangeMap.Builder<K,V> put(Range<K> range, V value)
      Put a range-value mapping into the builder. 向构建器放入范围-值映射。
      Parameters:
      range - the range | 范围
      value - the value | 值
      Returns:
      this builder | 此构建器
    • putAll

      public ImmutableRangeMap.Builder<K,V> putAll(RangeMap<K, ? extends V> other)
      Put all mappings from another range map. 从另一个范围映射放入所有映射。
      Parameters:
      other - the other range map | 另一个范围映射
      Returns:
      this builder | 此构建器
    • build

      public ImmutableRangeMap<K,V> build()
      Build the immutable range map. 构建不可变范围映射。
      Returns:
      immutable range map | 不可变范围映射