This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-text.git
The following commit(s) were added to refs/heads/master by this push: new 6d3f297 Javadoc. 6d3f297 is described below commit 6d3f297375515b3460483bffdd8dd4423df59b42 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Fri Jun 26 12:17:40 2020 -0400 Javadoc. --- .../text/matcher/AbstractStringMatcher.java | 89 +++++++++------------- .../apache/commons/text/matcher/StringMatcher.java | 2 +- 2 files changed, 35 insertions(+), 56 deletions(-) diff --git a/src/main/java/org/apache/commons/text/matcher/AbstractStringMatcher.java b/src/main/java/org/apache/commons/text/matcher/AbstractStringMatcher.java index a5b71c4..22930af 100644 --- a/src/main/java/org/apache/commons/text/matcher/AbstractStringMatcher.java +++ b/src/main/java/org/apache/commons/text/matcher/AbstractStringMatcher.java @@ -24,6 +24,7 @@ import java.util.Arrays; * <p> * This class comes complete with various factory methods. If these do not suffice, you can subclass and implement your * own matcher. + * </p> * * @since 1.3 */ @@ -38,10 +39,9 @@ abstract class AbstractStringMatcher implements StringMatcher { private final char ch; /** - * Constructor that creates a matcher that matches a single character. + * Constructs a matcher for a single character. * - * @param ch - * the character to match + * @param ch the character to match */ CharMatcher(final char ch) { super(); @@ -51,14 +51,10 @@ abstract class AbstractStringMatcher implements StringMatcher { /** * Returns whether or not the given character matches. * - * @param buffer - * the text content to match against, do not change - * @param start - * the starting position for the match, valid for buffer - * @param bufferStart - * the first active index in the buffer, valid for buffer - * @param bufferEnd - * the end index of the active buffer, valid for buffer + * @param buffer the text content to match against, do not change + * @param start the starting position for the match, valid for buffer + * @param bufferStart unused + * @param bufferEnd unused * @return The number of matching characters, zero for no match */ @Override @@ -86,10 +82,9 @@ abstract class AbstractStringMatcher implements StringMatcher { private final char[] chars; /** - * Constructor that creates a matcher from a character array. + * Constructs a matcher from a character array. * - * @param chars - * the characters to match, must not be null + * @param chars the characters to match, must not be null */ CharSetMatcher(final char[] chars) { super(); @@ -100,14 +95,10 @@ abstract class AbstractStringMatcher implements StringMatcher { /** * Returns whether or not the given character matches. * - * @param buffer - * the text content to match against, do not change - * @param start - * the starting position for the match, valid for buffer - * @param bufferStart - * the first active index in the buffer, valid for buffer - * @param bufferEnd - * the end index of the active buffer, valid for buffer + * @param buffer the text content to match against, do not change + * @param start the starting position for the match, valid for buffer + * @param bufferStart unused + * @param bufferEnd unused * @return The number of matching characters, zero for no match */ @Override @@ -142,14 +133,10 @@ abstract class AbstractStringMatcher implements StringMatcher { /** * Always returns {@code false}. * - * @param buffer - * the text content to match against, do not change - * @param start - * the starting position for the match, valid for buffer - * @param bufferStart - * the first active index in the buffer, valid for buffer - * @param bufferEnd - * the end index of the active buffer, valid for buffer + * @param buffer unused + * @param start unused + * @param bufferStart unused + * @param bufferEnd unused * @return The number of matching characters, zero for no match */ @Override @@ -178,10 +165,9 @@ abstract class AbstractStringMatcher implements StringMatcher { private final char[] chars; /** - * Constructor that creates a matcher from a String. + * Constructs a matcher from a String. * - * @param str - * the string to match, must not be null + * @param str the string to match, must not be null */ StringMatcher(final String str) { super(); @@ -191,14 +177,10 @@ abstract class AbstractStringMatcher implements StringMatcher { /** * Returns whether or not the given text matches the stored string. * - * @param buffer - * the text content to match against, do not change - * @param start - * the starting position for the match, valid for buffer - * @param bufferStart - * the first active index in the buffer, valid for buffer - * @param bufferEnd - * the end index of the active buffer, valid for buffer + * @param buffer the text content to match against, do not change + * @param start the starting position for the match, valid for buffer + * @param bufferStart unused + * @param bufferEnd the end index of the active buffer, valid for buffer * @return The number of matching characters, zero for no match */ @Override @@ -252,14 +234,10 @@ abstract class AbstractStringMatcher implements StringMatcher { /** * Returns whether or not the given character matches. * - * @param buffer - * the text content to match against, do not change - * @param start - * the starting position for the match, valid for buffer - * @param bufferStart - * the first active index in the buffer, valid for buffer - * @param bufferEnd - * the end index of the active buffer, valid for buffer + * @param buffer the text content to match against, do not change + * @param start the starting position for the match, valid for buffer + * @param bufferStart unused + * @param bufferEnd unused * @return The number of matching characters, zero for no match */ @Override @@ -291,17 +269,18 @@ abstract class AbstractStringMatcher implements StringMatcher { * This method is called to check for a match. The parameter {@code pos} represents the current position to be * checked in the string {@code buffer} (a character array which must not be changed). The API guarantees that * {@code pos} is a valid index for {@code buffer}. + * </p> * <p> - * The matching code may check one character or many. It may check characters preceding {@code pos} as well as - * those after. + * The matching code may check one character or many. It may check characters preceding {@code pos} as well as those + * after. + * </p> * <p> * It must return zero for no match, or a positive number if a match was found. The number indicates the number of * characters that matched. + * </p> * - * @param buffer - * the text content to match against, do not change - * @param pos - * the starting position for the match, valid for buffer + * @param buffer the text content to match against, do not change + * @param pos the starting position for the match, valid for buffer * @return The number of matching characters, zero for no match */ public int isMatch(final char[] buffer, final int pos) { diff --git a/src/main/java/org/apache/commons/text/matcher/StringMatcher.java b/src/main/java/org/apache/commons/text/matcher/StringMatcher.java index 111919f..12c7592 100644 --- a/src/main/java/org/apache/commons/text/matcher/StringMatcher.java +++ b/src/main/java/org/apache/commons/text/matcher/StringMatcher.java @@ -33,7 +33,7 @@ public interface StringMatcher { * </p> * <p> * The character array may be larger than the active area to be matched. Only values in the buffer between the - * specified indices may be accessed. + * specified indices may be accessed, in other words: {@code bufferStart <= start < bufferEnd}. * </p> * <p> * The matching code may check one character or many. It may check characters preceding {@code start} as well as