org.apache.xerces.impl.xpath.regex
Class Match

java.lang.Object
  extended by org.apache.xerces.impl.xpath.regex.Match
All Implemented Interfaces:
java.lang.Cloneable

public class Match
extends java.lang.Object
implements java.lang.Cloneable

An instance of this class has ranges captured in matching.

Version:
$Id: Match.java 446721 2006-09-15 20:35:34Z mrglavas $
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
Match()
          Creates an instance.
 
Method Summary
 java.lang.Object clone()
           
 int getBeginning(int index)
          Return a start position in the target text matched to specified regular expression group.
 java.lang.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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Match

public Match()
Creates an instance.

Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

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 than getNumberOfGroups().

getEnd

public int getEnd(int index)
Return an end position in the target text matched to specified regular expression group.

Parameters:
index - Less than getNumberOfGroups().

getCapturedText

public java.lang.String getCapturedText(int index)
Return an substring of the target text matched to specified regular expression group.

Parameters:
index - Less than getNumberOfGroups().