# HG changeset patch # User lancea # Date 1527870499 14400 # Node ID d52bba1f19aaaa6c886c63d063a109c86e8f7369 # Parent ede65c4fb6daa614a03c0c134668de035fc5cd1c 8190417: javadoc updates to java.util.regex.Matcher Reviewed-by: lancea, alanb, dholmes Contributed-by: Michal Vala diff -r ede65c4fb6da -r d52bba1f19aa src/java.base/share/classes/java/util/regex/Matcher.java --- a/src/java.base/share/classes/java/util/regex/Matcher.java Mon May 21 13:23:55 2018 -0400 +++ b/src/java.base/share/classes/java/util/regex/Matcher.java Fri Jun 01 12:28:19 2018 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,8 +37,8 @@ import java.util.stream.StreamSupport; /** - * An engine that performs match operations on a {@linkplain java.lang.CharSequence - * character sequence} by interpreting a {@link Pattern}. + * An engine that performs match operations on a {@linkplain + * java.lang.CharSequence character sequence} by interpreting a {@link Pattern}. * *

A matcher is created from a pattern by invoking the pattern's {@link * Pattern#matcher matcher} method. Once created, a matcher can be used to @@ -52,8 +52,8 @@ *

  • The {@link #lookingAt lookingAt} method attempts to match the * input sequence, starting at the beginning, against the pattern.

  • * - *
  • The {@link #find find} method scans the input sequence looking for - * the next subsequence that matches the pattern.

  • + *
  • The {@link #find find} method scans the input sequence looking + * for the next subsequence that matches the pattern.

  • * * * @@ -63,12 +63,12 @@ * *

    A matcher finds matches in a subset of its input called the * region. By default, the region contains all of the matcher's input. - * The region can be modified via the {@link #region region} method and queried - * via the {@link #regionStart regionStart} and {@link #regionEnd regionEnd} - * methods. The way that the region boundaries interact with some pattern - * constructs can be changed. See {@link #useAnchoringBounds - * useAnchoringBounds} and {@link #useTransparentBounds useTransparentBounds} - * for more details. + * The region can be modified via the {@link #region(int, int) region} method + * and queried via the {@link #regionStart() regionStart} and {@link + * #regionEnd() regionEnd} methods. The way that the region boundaries interact + * with some pattern constructs can be changed. See {@link + * #useAnchoringBounds(boolean) useAnchoringBounds} and {@link + * #useTransparentBounds(boolean) useTransparentBounds} for more details. * *

    This class also defines methods for replacing matched subsequences with * new strings whose contents can, if desired, be computed from the match @@ -586,8 +586,8 @@ * *

    For a matcher m with input sequence s, * the expressions m.{@code group()} and - * s.{@code substring(}m.{@code start(),} m.{@code end())} - * are equivalent.

    + * s.{@code substring(}m.{@code start(),} m. + * {@code end())} are equivalent.

    * *

    Note that some patterns, for example {@code a*}, match the empty * string. This method will return the empty string when the pattern @@ -652,8 +652,8 @@ /** * Returns the input subsequence captured by the given - * named-capturing group during the previous - * match operation. + * named-capturing group during the + * previous match operation. * *

    If the match was successful but the group specified failed to match * any part of the input sequence, then {@code null} is returned. Note @@ -866,9 +866,9 @@ * string. * *

    This method is intended to be used in a loop together with the - * {@link #appendTail appendTail} and {@link #find find} methods. The - * following code, for example, writes {@code one dog two dogs in the - * yard} to the standard-output stream:

    + * {@link #appendTail(StringBuffer) appendTail} and {@link #find() find} + * methods. The following code, for example, writes {@code one dog two dogs + * in the yard} to the standard-output stream:

    * *
          * Pattern p = Pattern.compile("cat");
    @@ -959,9 +959,9 @@
          * string.
          *
          * 

    This method is intended to be used in a loop together with the - * {@link #appendTail appendTail} and {@link #find find} methods. The - * following code, for example, writes {@code one dog two dogs in the - * yard} to the standard-output stream:

    + * {@link #appendTail(StringBuilder) appendTail} and + * {@link #find() find} methods. The following code, for example, writes + * {@code one dog two dogs in the yard} to the standard-output stream:

    * *
          * Pattern p = Pattern.compile("cat");
    @@ -1104,8 +1104,8 @@
          * 

    This method reads characters from the input sequence, starting at * the append position, and appends them to the given string buffer. It is * intended to be invoked after one or more invocations of the {@link - * #appendReplacement appendReplacement} method in order to copy the - * remainder of the input sequence.

    + * #appendReplacement(StringBuffer, String) appendReplacement} method in + * order to copy the remainder of the input sequence.

    * * @param sb * The target string buffer @@ -1123,8 +1123,9 @@ *

    This method reads characters from the input sequence, starting at * the append position, and appends them to the given string builder. It is * intended to be invoked after one or more invocations of the {@link - * #appendReplacement appendReplacement} method in order to copy the - * remainder of the input sequence.

    + * #appendReplacement(StringBuilder, String) + * appendReplacement} method in order to copy the remainder of the input + * sequence.

    * * @param sb * The target string builder @@ -1490,10 +1491,10 @@ * index specified by the {@code end} parameter. * *

    Depending on the transparency and anchoring being used (see - * {@link #useTransparentBounds useTransparentBounds} and - * {@link #useAnchoringBounds useAnchoringBounds}), certain constructs such - * as anchors may behave differently at or around the boundaries of the - * region. + * {@link #useTransparentBounds(boolean) useTransparentBounds} and + * {@link #useAnchoringBounds(boolean) useAnchoringBounds}), certain + * constructs such as anchors may behave differently at or around the + * boundaries of the region. * * @param start * The index to start searching at (inclusive) @@ -1523,8 +1524,8 @@ /** * Reports the start index of this matcher's region. The * searches this matcher conducts are limited to finding matches - * within {@link #regionStart regionStart} (inclusive) and - * {@link #regionEnd regionEnd} (exclusive). + * within {@link #regionStart() regionStart} (inclusive) and + * {@link #regionEnd() regionEnd} (exclusive). * * @return The starting point of this matcher's region * @since 1.5 @@ -1536,8 +1537,8 @@ /** * Reports the end index (exclusive) of this matcher's region. * The searches this matcher conducts are limited to finding matches - * within {@link #regionStart regionStart} (inclusive) and - * {@link #regionEnd regionEnd} (exclusive). + * within {@link #regionStart() regionStart} (inclusive) and + * {@link #regionEnd() regionEnd} (exclusive). * * @return the ending point of this matcher's region * @since 1.5 @@ -1553,7 +1554,7 @@ * transparent bounds, {@code false} if it uses opaque * bounds. * - *

    See {@link #useTransparentBounds useTransparentBounds} for a + *

    See {@link #useTransparentBounds(boolean) useTransparentBounds} for a * description of transparent and opaque bounds. * *

    By default, a matcher uses opaque region boundaries. @@ -1604,7 +1605,7 @@ *

    This method returns {@code true} if this matcher uses * anchoring bounds, {@code false} otherwise. * - *

    See {@link #useAnchoringBounds useAnchoringBounds} for a + *

    See {@link #useAnchoringBounds(boolean) useAnchoringBounds} for a * description of anchoring bounds. * *

    By default, a matcher uses anchoring region boundaries. @@ -1770,18 +1771,18 @@ } /** - * Generates a String from this Matcher's input in the specified range. + * Generates a String from this matcher's input in the specified range. * * @param beginIndex the beginning index, inclusive * @param endIndex the ending index, exclusive - * @return A String generated from this Matcher's input + * @return A String generated from this matcher's input */ CharSequence getSubSequence(int beginIndex, int endIndex) { return text.subSequence(beginIndex, endIndex); } /** - * Returns this Matcher's input character at index i. + * Returns this matcher's input character at index i. * * @return A char from the specified index */ @@ -1802,4 +1803,4 @@ throw new IllegalArgumentException("No group with name <" + name + ">"); return parentPattern.namedGroups().get(name); } -} +} \ No newline at end of file