Package org.apache.xmlbeans.impl.regex
Class Match
java.lang.Object
org.apache.xmlbeans.impl.regex.Match
- All Implemented Interfaces:
Cloneable
public class Match extends Object implements Cloneable
An instance of this class has ranges captured in matching.
- Author:
- TAMURA Kent <kent@trl.ibm.co.jp>
- See Also:
RegularExpression.matches(char[], int, int, Match)
,RegularExpression.matches(char[], Match)
,RegularExpression.matches(java.text.CharacterIterator, Match)
,RegularExpression.matches(java.lang.String, int, int, Match)
,RegularExpression.matches(java.lang.String, Match)
-
Constructor Summary
Constructors Constructor Description Match()
Creates an instance. -
Method Summary
Modifier and Type Method Description Object
clone()
int
getBeginning(int index)
Return a start position in the target text matched to specified regular expression group.String
getCapturedText(int index)
Return an substring of the target text matched to specified regular expression group.int
getEnd(int index)
Return an end position in the target text matched to specified regular expression group.int
getNumberOfGroups()
Return the number of regular expression groups.protected void
setBeginning(int index, int v)
protected void
setEnd(int index, int v)
protected void
setNumberOfGroups(int n)
protected void
setSource(char[] chars)
protected void
setSource(String str)
protected void
setSource(CharacterIterator ci)
-
Constructor Details
-
Match
public Match()Creates an instance.
-
-
Method Details
-
clone
-
setNumberOfGroups
protected void setNumberOfGroups(int n) -
setSource
-
setSource
-
setSource
protected void setSource(char[] chars) -
setBeginning
protected void setBeginning(int index, int v) -
setEnd
protected void setEnd(int index, int v) -
getNumberOfGroups
public int getNumberOfGroups()Return the number of regular expression groups. This method returns 1 when the regular expression has no capturing-parenthesis. -
getBeginning
public int getBeginning(int index)Return a start position in the target text matched to specified regular expression group.- Parameters:
index
- Less thangetNumberOfGroups()
.
-
getEnd
public int getEnd(int index)Return an end position in the target text matched to specified regular expression group.- Parameters:
index
- Less thangetNumberOfGroups()
.
-
getCapturedText
Return an substring of the target text matched to specified regular expression group.- Parameters:
index
- Less thangetNumberOfGroups()
.
-