Skip to content

Commit

Permalink
Add missing Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Dec 28, 2024
1 parent 4d917fa commit 10fd9a4
Show file tree
Hide file tree
Showing 13 changed files with 201 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@ public static String toAsciiString(final byte[] raw) {
return new String(toAsciiChars(raw));
}

/**
* Constructs a new instance.
*/
public BinaryCodec() {
// empty
}

/**
* Decodes a byte array where each byte represents an ASCII '0' or '1'.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@
*/
public class CharSequenceUtils {

/**
* Consider package-private.
*
* @deprecated Will be package-private in the next major version.
*/
@Deprecated
public CharSequenceUtils() {
// empty
}

/**
* Green implementation of regionMatches.
*
Expand Down Expand Up @@ -86,4 +76,14 @@ static boolean regionMatches(final CharSequence cs, final boolean ignoreCase, fi
}
return true;
}

/**
* Consider private.
*
* @deprecated Will be private in the next major version.
*/
@Deprecated
public CharSequenceUtils() {
// empty
}
}
14 changes: 14 additions & 0 deletions src/main/java/org/apache/commons/codec/digest/MurmurHash3.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ public final class MurmurHash3 {
@Deprecated
public static class IncrementalHash32 extends IncrementalHash32x86 {

/**
* Constructs a new instance.
*/
public IncrementalHash32() {
// empty
}

/**
* {@inheritDoc}
*
Expand Down Expand Up @@ -155,6 +162,13 @@ private static int orBytes(final byte b1, final byte b2, final byte b3, final by
*/
private int hash;

/**
* Constructs a new instance.
*/
public IncrementalHash32x86() {
// empty
}

/**
* Adds the byte array to the current incremental hash.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,19 @@
public abstract class AbstractCaverphone implements StringEncoder {

/**
* Encodes an Object using the caverphone algorithm. This method is provided in order to satisfy the requirements of
* Constructs a new instance for subclasses.
*/
public AbstractCaverphone() {
// empty
}

/**
* Encodes an Object using the Caverphone algorithm. This method is provided in order to satisfy the requirements of
* the Encoder interface, and will throw an EncoderException if the supplied object is not of type {@link String}.
*
* @param source
* Object to encode
* @return An object (or type {@link String}) containing the caverphone code which corresponds to the String
* @return An object (or type {@link String}) containing the Caverphone code which corresponds to the String
* supplied.
* @throws EncoderException
* if the parameter supplied is not of type {@link String}.
Expand Down
19 changes: 13 additions & 6 deletions src/main/java/org/apache/commons/codec/language/Caverphone.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,31 @@ public class Caverphone implements StringEncoder {
*/
private final Caverphone2 encoder = new Caverphone2();

/**
* Constructs a new instance.
*/
public Caverphone() {
// empty
}

/**
* Encodes the given String into a Caverphone value.
*
* @param source
* String the source string
* @return A caverphone code for the given String
* @return A Caverphone code for the given String
*/
public String caverphone(final String source) {
return this.encoder.encode(source);
}

/**
* Encodes an Object using the caverphone algorithm. This method is provided in order to satisfy the requirements of
* Encodes an Object using the Caverphone algorithm. This method is provided in order to satisfy the requirements of
* the Encoder interface, and will throw an EncoderException if the supplied object is not of type {@link String}.
*
* @param obj
* Object to encode
* @return An object (or type {@link String}) containing the caverphone code which corresponds to the String
* @return An object (or type {@link String}) containing the Caverphone code which corresponds to the String
* supplied.
* @throws EncoderException
* if the parameter supplied is not of type {@link String}.
Expand All @@ -74,21 +81,21 @@ public Object encode(final Object obj) throws EncoderException {
*
* @param str
* String object to encode
* @return The caverphone code corresponding to the String supplied
* @return The Caverphone code corresponding to the String supplied
*/
@Override
public String encode(final String str) {
return caverphone(str);
}

/**
* Tests if the caverphones of two strings are identical.
* Tests if the Caverphones of two strings are identical.
*
* @param str1
* First of two strings to compare
* @param str2
* Second of two strings to compare
* @return {@code true} if the caverphones of these strings are identical, {@code false} otherwise.
* @return {@code true} if the Caverphones of these strings are identical, {@code false} otherwise.
*/
public boolean isCaverphoneEqual(final String str1, final String str2) {
return caverphone(str1).equals(caverphone(str2));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,19 @@ public class Caverphone1 extends AbstractCaverphone {

private static final String SIX_1 = "111111";

/**
* Constructs a new instance.
*/
public Caverphone1() {
// empty
}

/**
* Encodes the given String into a Caverphone value.
*
* @param source
* String the source string
* @return A caverphone code for the given String
* @return A Caverphone code for the given String
*/
@Override
public String encode(final String source) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,19 @@ public class Caverphone2 extends AbstractCaverphone {

private static final String TEN_1 = "1111111111";

/**
* Constructs a new instance.
*/
public Caverphone2() {
// empty
}

/**
* Encodes the given String into a Caverphone 2.0 value.
*
* @param source
* String the source string
* @return A caverphone code for the given String
* @return A Caverphone code for the given String
*/
@Override
public String encode(final String source) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,13 @@ private static boolean arrayContains(final char[] arr, final char key) {
return false;
}

/**
* Constructs a new instance.
*/
public ColognePhonetic() {
// empty
}

/**
* <p>
* Implements the <em>K&ouml;lner Phonetik</em> algorithm.
Expand Down
Loading

0 comments on commit 10fd9a4

Please sign in to comment.