public abstract class AbstractFilter extends Object implements BloomFilter
| Modifier and Type | Field and Description |
|---|---|
protected int |
size
容量
|
| Constructor and Description |
|---|
AbstractFilter(int size)
构造
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(String str)
在boolean的bitMap中增加一个字符串
如果存在就返回 false .如果不存在.先增加这个字符串.再返回true |
boolean |
contains(String str) |
abstract int |
hash(String str)
自定义Hash方法
|
public boolean contains(String str)
contains in interface BloomFilterstr - 字符串public boolean add(String str)
BloomFilterfalse .如果不存在.先增加这个字符串.再返回trueadd in interface BloomFilterstr - 字符串false .如果不存在返回truepublic abstract int hash(String str)
str - 字符串Copyright © 2025. All rights reserved.