Remove javadocs in overridden methods that are duplicates.
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.
This commit is contained in:
parent
2a9bdc0098
commit
a51c96520a
|
@ -53,13 +53,6 @@ public abstract class AbstractBloomFilter implements BloomFilter {
|
||||||
this.shape = shape;
|
this.shape = shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Performs a logical "AND" with the other Bloom filter and returns the cardinality of
|
|
||||||
* the result.
|
|
||||||
*
|
|
||||||
* @param other the other Bloom filter.
|
|
||||||
* @return the cardinality of the result of {@code ( this AND other )}.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int andCardinality(final BloomFilter other) {
|
public int andCardinality(final BloomFilter other) {
|
||||||
verifyShape(other);
|
verifyShape(other);
|
||||||
|
@ -73,11 +66,6 @@ public abstract class AbstractBloomFilter implements BloomFilter {
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the cardinality of this Bloom filter.
|
|
||||||
*
|
|
||||||
* @return the cardinality (number of enabled bits) in this filter.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int cardinality() {
|
public int cardinality() {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
@ -87,28 +75,12 @@ public abstract class AbstractBloomFilter implements BloomFilter {
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Performs a contains check. Effectively this AND other == other.
|
|
||||||
*
|
|
||||||
* @param other the Other Bloom filter.
|
|
||||||
* @return true if this filter matches the other.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean contains(final BloomFilter other) {
|
public boolean contains(final BloomFilter other) {
|
||||||
verifyShape(other);
|
verifyShape(other);
|
||||||
return other.cardinality() == andCardinality(other);
|
return other.cardinality() == andCardinality(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Performs a contains check against a decomposed Bloom filter. The shape must match
|
|
||||||
* the shape of this filter. The hasher provides bit indexes to check for. Effectively
|
|
||||||
* decomposed AND this == decomposed.
|
|
||||||
*
|
|
||||||
* @param hasher The hasher containing the bits to check.
|
|
||||||
* @return true if this filter contains the other.
|
|
||||||
* @throws IllegalArgumentException if the shape argument does not match the shape of
|
|
||||||
* this filter, or if the hasher is not the specified one
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean contains(final Hasher hasher) {
|
public boolean contains(final Hasher hasher) {
|
||||||
verifyHasher(hasher);
|
verifyHasher(hasher);
|
||||||
|
@ -127,29 +99,12 @@ public abstract class AbstractBloomFilter implements BloomFilter {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets an array of little-endian long values representing the on bits of this filter.
|
|
||||||
* bits 0-63 are in the first long.
|
|
||||||
*
|
|
||||||
* @return the LongBuffer representation of this filter.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public abstract long[] getBits();
|
public abstract long[] getBits();
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a StaticHasher that contains the indexes of the bits that are on in this
|
|
||||||
* filter.
|
|
||||||
*
|
|
||||||
* @return a StaticHasher for that produces this Bloom filter.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public abstract StaticHasher getHasher();
|
public abstract StaticHasher getHasher();
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the shape of this filter.
|
|
||||||
*
|
|
||||||
* @return The shape of this filter.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public final Shape getShape() {
|
public final Shape getShape() {
|
||||||
return shape;
|
return shape;
|
||||||
|
@ -165,22 +120,9 @@ public abstract class AbstractBloomFilter implements BloomFilter {
|
||||||
return cardinality() == getShape().getNumberOfBits();
|
return cardinality() == getShape().getNumberOfBits();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Merge the other Bloom filter into this one.
|
|
||||||
*
|
|
||||||
* @param other the other Bloom filter.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public abstract void merge(BloomFilter other);
|
public abstract void merge(BloomFilter other);
|
||||||
|
|
||||||
/**
|
|
||||||
* Merge the decomposed Bloom filter defined by the hasher into this Bloom
|
|
||||||
* filter. The hasher provides an iterator of bit indexes to enable.
|
|
||||||
*
|
|
||||||
* @param hasher the hasher to provide the indexes.
|
|
||||||
* @throws IllegalArgumentException if the shape argument does not match the shape of
|
|
||||||
* this filter, or if the hasher is not the specified one
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public abstract void merge(Hasher hasher);
|
public abstract void merge(Hasher hasher);
|
||||||
|
|
||||||
|
@ -229,13 +171,6 @@ public abstract class AbstractBloomFilter implements BloomFilter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Performs a logical "XOR" with the other Bloom filter and returns the cardinality of
|
|
||||||
* the result.
|
|
||||||
*
|
|
||||||
* @param other the other Bloom filter.
|
|
||||||
* @return the cardinality of the result of {@code( this XOR other )}
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int xorCardinality(final BloomFilter other) {
|
public int xorCardinality(final BloomFilter other) {
|
||||||
// Logical XOR
|
// Logical XOR
|
||||||
|
|
|
@ -117,7 +117,7 @@ public interface BloomFilter {
|
||||||
* the result.
|
* the result.
|
||||||
*
|
*
|
||||||
* @param other the other Bloom filter.
|
* @param other the other Bloom filter.
|
||||||
* @return the cardinality of the result of {@code( this XOR other )}
|
* @return the cardinality of the result of {@code ( this XOR other )}
|
||||||
*/
|
*/
|
||||||
int xorCardinality(BloomFilter other);
|
int xorCardinality(BloomFilter other);
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,16 +164,6 @@ public class DynamicHasher implements Hasher {
|
||||||
this.function = function;
|
this.function = function;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets an iterator of integers that are the bits to enable in the Bloom filter
|
|
||||||
* based on the shape. The iterator may return the same value multiple times. There is
|
|
||||||
* no guarantee made as to the order of the integers.
|
|
||||||
*
|
|
||||||
* @param shape the shape of the desired Bloom filter.
|
|
||||||
* @return the Iterator of integers;
|
|
||||||
* @throws IllegalArgumentException if {@code shape.getHasherName()} does not equal
|
|
||||||
* {@code getName()}
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public PrimitiveIterator.OfInt getBits(final Shape shape) {
|
public PrimitiveIterator.OfInt getBits(final Shape shape) {
|
||||||
HashFunctionValidator.checkAreEqual(getHashFunctionIdentity(),
|
HashFunctionValidator.checkAreEqual(getHashFunctionIdentity(),
|
||||||
|
|
|
@ -96,10 +96,9 @@ public final class StaticHasher implements Hasher {
|
||||||
* filter based on the shape. The iterator will not return the same value multiple
|
* filter based on the shape. The iterator will not return the same value multiple
|
||||||
* times. Values will be returned in ascending order.
|
* times. Values will be returned in ascending order.
|
||||||
*
|
*
|
||||||
* @param shape the shape of the desired Bloom filter.
|
* @param shape {@inheritDoc}
|
||||||
* @return the Iterator of integers;
|
* @return {@inheritDoc}
|
||||||
* @throws IllegalArgumentException if {@code shape.getHasherName()} does not
|
* @throws IllegalArgumentException {@inheritDoc}
|
||||||
* equal {@code getName()}
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public OfInt getBits(final Shape shape) {
|
public OfInt getBits(final Shape shape) {
|
||||||
|
|
Loading…
Reference in New Issue