From a51c96520a73dd3d2655267e07642ada49a109ee Mon Sep 17 00:00:00 2001 From: aherbert Date: Thu, 12 Mar 2020 14:22:18 +0000 Subject: [PATCH] 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. --- .../bloomfilter/AbstractBloomFilter.java | 65 ------------------- .../collections4/bloomfilter/BloomFilter.java | 2 +- .../bloomfilter/hasher/DynamicHasher.java | 10 --- .../bloomfilter/hasher/StaticHasher.java | 7 +- 4 files changed, 4 insertions(+), 80 deletions(-) diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/AbstractBloomFilter.java b/src/main/java/org/apache/commons/collections4/bloomfilter/AbstractBloomFilter.java index 8a6b948ee..90f274b59 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/AbstractBloomFilter.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/AbstractBloomFilter.java @@ -53,13 +53,6 @@ public abstract class AbstractBloomFilter implements BloomFilter { 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 public int andCardinality(final BloomFilter other) { verifyShape(other); @@ -73,11 +66,6 @@ public abstract class AbstractBloomFilter implements BloomFilter { return count; } - /** - * Gets the cardinality of this Bloom filter. - * - * @return the cardinality (number of enabled bits) in this filter. - */ @Override public int cardinality() { int count = 0; @@ -87,28 +75,12 @@ public abstract class AbstractBloomFilter implements BloomFilter { 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 public boolean contains(final BloomFilter other) { verifyShape(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 public boolean contains(final Hasher hasher) { verifyHasher(hasher); @@ -127,29 +99,12 @@ public abstract class AbstractBloomFilter implements BloomFilter { 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 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 public abstract StaticHasher getHasher(); - /** - * Gets the shape of this filter. - * - * @return The shape of this filter. - */ @Override public final Shape getShape() { return shape; @@ -165,22 +120,9 @@ public abstract class AbstractBloomFilter implements BloomFilter { return cardinality() == getShape().getNumberOfBits(); } - /** - * Merge the other Bloom filter into this one. - * - * @param other the other Bloom filter. - */ @Override 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 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 public int xorCardinality(final BloomFilter other) { // Logical XOR diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilter.java b/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilter.java index 9d982021b..33c646759 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilter.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilter.java @@ -117,7 +117,7 @@ public interface BloomFilter { * the result. * * @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); } diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/DynamicHasher.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/DynamicHasher.java index 251402f5c..e36133fe6 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/DynamicHasher.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/DynamicHasher.java @@ -164,16 +164,6 @@ public class DynamicHasher implements Hasher { 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 public PrimitiveIterator.OfInt getBits(final Shape shape) { HashFunctionValidator.checkAreEqual(getHashFunctionIdentity(), diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/StaticHasher.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/StaticHasher.java index 676cc2f85..727d6ad14 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/StaticHasher.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/StaticHasher.java @@ -96,10 +96,9 @@ public final class StaticHasher implements Hasher { * filter based on the shape. The iterator will not return the same value multiple * times. Values will be returned in ascending order. * - * @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()} + * @param shape {@inheritDoc} + * @return {@inheritDoc} + * @throws IllegalArgumentException {@inheritDoc} */ @Override public OfInt getBits(final Shape shape) {