org.enhydra.apache.xerces.utils.regex
Class Match

java.lang.Object
  |
  +--org.enhydra.apache.xerces.utils.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, org.enhydra.apache.xerces.utils.regex.Match), RegularExpression.matches(char[], org.enhydra.apache.xerces.utils.regex.Match), RegularExpression.matches(java.text.CharacterIterator, org.enhydra.apache.xerces.utils.regex.Match), RegularExpression.matches(java.lang.String, int, int, org.enhydra.apache.xerces.utils.regex.Match), RegularExpression.matches(java.lang.String, org.enhydra.apache.xerces.utils.regex.Match)

Field Summary
(package private)  int[] beginpos
           
(package private)  char[] charSource
           
(package private)  CharacterIterator ciSource
           
(package private)  int[] endpos
           
(package private)  int nofgroups
           
(package private)  String strSource
           
 
Constructor Summary
Match()
          Creates an instance.
 
Method Summary
 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(CharacterIterator ci)
           
protected  void setSource(String str)
           
 
Methods inherited from class java.lang.Object
, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

beginpos

int[] beginpos

endpos

int[] endpos

nofgroups

int nofgroups

ciSource

CharacterIterator ciSource

strSource

String strSource

charSource

char[] charSource
Constructor Detail

Match

public Match()
Creates an instance.
Method Detail

clone

public Object clone()
Overrides:
clone in class Object

setNumberOfGroups

protected void setNumberOfGroups(int n)

setSource

protected void setSource(CharacterIterator ci)

setSource

protected void setSource(String str)

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 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 String getCapturedText(int index)
Return an substring of the target text matched to specified regular expression group.
Parameters:
index - Less than getNumberOfGroups().


Copyright © 1999 The Apache Software Foundation. All Rights reserved.