Add default methods to add a CharSequenece.
Make it clear each object added to the Builder should represent an
entire item.
Document that build() should reset the builder for future use.
Avoid using Arrays.deepHashCode. The array passed to deepHashCode is
always length 2. So we can unroll the same computation for the fixed 2
iterations.
Remove trailing periods from params and returns.
Remove the specification in the Hasher.Builder to convert the String to
bytes using the UTF-8 charset. This is an implementation detail. It has
been moved to the DynamicHasher implementation.
Update exception message for getBits to be less specific. The reference
to getName() is now obsolete.
Remove trailing periods on parameters and arguments.
Remove reference to LongBuffer. Clarify what the long[] represents in
'long[] getBits()'.
Clarify cardinality using (number of enabled bits).
Rearrange BloomFilter interface methods to functional order. The order
is:
- Query operations
- Modification operations
- Counting operations
Improve javadoc for BloomFilter contains with additional information for
what 'contains' means.
Update exception message for contains/merge/add/subtract to be
consistent.
This is to support the extension to a counting Bloom filter which can
return true/false if the state is valid.
Drops redundant abstract methods from the AbstractBloomFilter that are
overrides of the BloomFilter interface .
Update documented exception conditions.
Update javadoc for the shape properties to drop AKA abbreviation.
Change Probability of collision to Probability of False positives.
Update the getProbability method to document it applies to a filter full
to the intended capacity.
An exact copy of the javadoc is redundant. It also means updates to the
parent get lost by those inheriting. It is better to use {@inheritDoc}
and add extra information.
Since HashFunctionIdentity is an interface there is no control over what
is hashed. Add a hash function to the HashFunctionValidator to ensure
the hash code is the same if two hash functions are equal according to
the hashFunctionIdentity.
Note: Since Shape is final we use the properties directly and not through the get methods.
Standardise the constructor assertions to functions.
Ensure Shape catches NaN probability in the constructor.
Previously NaN would result in a NaN computation for the number of bits.
When cast to int it would be zero. This change improves the error
message in the exception.
Clean-up javadocs.
Ensure Shape is final. If not final then the rest of the Bloom filter
API cannot assume that a Shape is valid as it may be extended and the
computations changed.
This is done by duplicating the and/or/xor cardinality tests and merge
tests in the AbtsractBloomFilterTest using the current filter type
(provided via abstract methods) and a generic BloomFilter
implementation.