| java.lang.Object org.apache.oro.text.awk.AwkMatchResult
AwkMatchResult | final class AwkMatchResult implements MatchResult(Code) | | A class used to store and access the results of an AwkPattern match.
It is important for you to remember that AwkMatcher does not save
parenthesized sub-group information. Therefore the number of groups
saved in an AwkMatchResult will always be 1.
version: @version@ since: 1.0 See Also: org.apache.oro.text.regex.PatternMatcher See Also: AwkMatcher See Also: AwkCompiler |
Constructor Summary | |
| AwkMatchResult(String match, int matchBeginOffset) Default constructor given default access to prevent instantiation
outside the package. |
Method Summary | |
void | _incrementMatchBeginOffset(int streamOffset) Adjusts the relative offset where the match begins to an absolute
value. | public int | begin(int group) Parameters: group - The pattern subgroup. | public int | beginOffset(int group) Returns an offset marking the beginning of the pattern match
relative to the beginning of the input.
Parameters: group - The pattern subgroup. | public int | end(int group) Parameters: group - The pattern subgroup. | public int | endOffset(int group) Returns an offset marking the end of the pattern match
relative to the beginning of the input.
Parameters: group - The pattern subgroup. | public String | group(int group) Parameters: group - The pattern subgroup to return. | public int | groups() The number of groups contained in the result. | public int | length() | public String | toString() The same as group(0). |
AwkMatchResult | AwkMatchResult(String match, int matchBeginOffset)(Code) | | Default constructor given default access to prevent instantiation
outside the package.
|
_incrementMatchBeginOffset | void _incrementMatchBeginOffset(int streamOffset)(Code) | | Adjusts the relative offset where the match begins to an absolute
value. Only used by AwkMatcher to adjust the offset for stream
matches.
|
begin | public int begin(int group)(Code) | | Parameters: group - The pattern subgroup. The offset into group 0 of the first token in the indicatedpattern subgroup. If a group was never matched or doesnot exist, returns -1. |
beginOffset | public int beginOffset(int group)(Code) | | Returns an offset marking the beginning of the pattern match
relative to the beginning of the input.
Parameters: group - The pattern subgroup. The offset of the first token in the indicatedpattern subgroup. If a group was never matched or doesnot exist, returns -1. |
end | public int end(int group)(Code) | | Parameters: group - The pattern subgroup. Returns one plus the offset into group 0 of the last token inthe indicated pattern subgroup. If a group was never matchedor does not exist, returns -1. A group matching the nullstring will return its start offset. |
endOffset | public int endOffset(int group)(Code) | | Returns an offset marking the end of the pattern match
relative to the beginning of the input.
Parameters: group - The pattern subgroup. Returns one plus the offset of the last token inthe indicated pattern subgroup. If a group was never matchedor does not exist, returns -1. A group matching the nullstring will return its start offset. |
group | public String group(int group)(Code) | | Parameters: group - The pattern subgroup to return. A string containing the indicated pattern subgroup. Group0 always refers to the entire match. If a group was nevermatched, it returns null. This is not to be confused witha group matching the null string, which will return a Stringof length 0. |
groups | public int groups()(Code) | | The number of groups contained in the result. This numberincludes the 0th group. In other words, the result refersto the number of parenthesized subgroups plus the entire matchitself. Because Awk doesn't save parenthesized groups, thisalways returns 1. |
length | public int length()(Code) | | The length of the match. |
toString | public String toString()(Code) | | The same as group(0).
A string containing the entire match. |
|
|