Interface BloomFilter

All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractFilter, CombinedBloomFilter, FunctionFilter

public interface BloomFilter extends Serializable
Bloom filter 是由 Howard Bloom 在 1970 年提出的二进制向量数据结构,它具有很好的空间和时间效率,被用来检测一个元素是不是集合中的一个成员。 如果检测结果为是,该元素不一定在集合中;但如果检测结果为否,该元素一定不在集合中。 因此Bloom filter具有100%的召回率。这样每个检测请求返回有“在集合内(可能错误)”和“不在集合内(绝对不在集合内)”两种情况。
Since:
Java 17+
Author:
Kimi Liu
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(String text)
    在boolean的bitMap中增加一个字符串 如果存在就返回false .如果不存在.先增加这个字符串.再返回true
    boolean
    否包含字符
  • Method Details

    • contains

      boolean contains(String text)
      否包含字符
      Parameters:
      text - 字符串
      Returns:
      判断一个字符串是否bitMap中存在
    • add

      boolean add(String text)
      在boolean的bitMap中增加一个字符串 如果存在就返回false .如果不存在.先增加这个字符串.再返回true
      Parameters:
      text - 字符串
      Returns:
      是否加入成功,如果存在就返回false .如果不存在返回true