public class BitMapBloomFilter extends Object implements BloomFilter
Constructor and Description |
---|
BitMapBloomFilter(int m)
构造,使用默认的5个过滤器
|
BitMapBloomFilter(int m,
BloomFilter... filters)
使用自定的多个过滤器建立BloomFilter
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(String str)
增加字符串到Filter映射中
|
boolean |
contains(String str)
是否可能包含此字符串,此处存在误判
|
public BitMapBloomFilter(int m)
m
- M值决定BitMap的大小public BitMapBloomFilter(int m, BloomFilter... filters)
m
- M值决定BitMap的大小filters
- Bloom过滤器列表public boolean add(String str)
add
in interface BloomFilter
str
- 字符串false
.如果不存在返回true
public boolean contains(String str)
contains
in interface BloomFilter
str
- 字符串Copyright © 2024. All rights reserved.