Class CountingBloomFilter.Builder<T>

java.lang.Object
cloud.opencode.base.hash.bloom.CountingBloomFilter.Builder<T>
Type Parameters:
T - element type | 元素类型
Enclosing class:
CountingBloomFilter<T>

public static final class CountingBloomFilter.Builder<T> extends Object
Builder for counting bloom filter 计数布隆过滤器构建器
Since:
JDK 25, opencode-base-hash V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • Builder

      public Builder(Funnel<? super T> funnel)
  • Method Details

    • expectedInsertions

      public CountingBloomFilter.Builder<T> expectedInsertions(long expectedInsertions)
      Sets the expected insertions 设置预期插入量
      Parameters:
      expectedInsertions - expected insertions | 预期插入量
      Returns:
      this builder | 此构建器
    • fpp

      public CountingBloomFilter.Builder<T> fpp(double fpp)
      Sets the false positive probability 设置误判率
      Parameters:
      fpp - false positive probability | 误判率
      Returns:
      this builder | 此构建器
    • counterBits

      public CountingBloomFilter.Builder<T> counterBits(int bits)
      Sets the counter bits (default 4) 设置计数器位数(默认4)
      Parameters:
      bits - counter bits | 计数器位数
      Returns:
      this builder | 此构建器
    • hashFunction

      public CountingBloomFilter.Builder<T> hashFunction(HashFunction hashFunction)
      Sets the hash function 设置哈希函数
      Parameters:
      hashFunction - hash function | 哈希函数
      Returns:
      this builder | 此构建器
    • build

      public CountingBloomFilter<T> build()
      Builds the counting bloom filter 构建计数布隆过滤器
      Returns:
      counting bloom filter | 计数布隆过滤器