BloomFilter<T> class

Production-ready Bloom Filter implementation

Constructors

BloomFilter.custom({required int size, required int hashFunctions, List<int>? seeds})
Creates a Bloom filter with custom configuration
BloomFilter.fromConfig(BloomFilterConfig config)
Creates a Bloom filter from existing configuration
BloomFilter.fromJson(Map<String, dynamic> json)
Creates Bloom filter from JSON representation
factory
BloomFilter.optimal({required int expectedElements, required double falsePositiveRate})
Creates an empty Bloom filter with optimal configuration

Properties

bitDensity → double
Gets the current bit density (fraction of bits set to 1)
no setter
config → BloomFilterConfig
final
elementCount → int
Gets the current number of elements in the filter
no setter
estimatedFalsePositiveRate → double
Gets the current false positive rate estimate
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(T element) → void
Adds an element to the Bloom filter
addAll(Iterable<T> elements) → void
Adds multiple elements in batch for efficiency
clear() → void
Clears all bits in the filter
contains(T element) → bool
Checks if an element is probably in the Bloom filter
containsAll(Iterable<T> elements) → List<bool>
Checks if multiple elements are probably in the filter
intersection(BloomFilter<T> other) → BloomFilter<T>
Performs intersection operation with another Bloom filter
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes the Bloom filter for storage/transmission
toString() → String
A string representation of this object.
override
union(BloomFilter<T> other) → BloomFilter<T>
Performs union operation with another Bloom filter

Operators

operator ==(Object other) → bool
The equality operator.
inherited