de.dfki.lt.tools.tokenizer.regexp
Class Match

java.lang.Object
  extended byde.dfki.lt.tools.tokenizer.regexp.Match

public class Match
extends java.lang.Object

Match holds the result of matching an input string with a regular expression.

Version:
$Id: Match.java,v 1.3 2005/04/12 08:47:37 steffen Exp $
Author:
Joerg Steffen, DFKI

Constructor Summary
Match(int aStart, int anEnd, java.lang.String anImage)
          This creates a new instance of Match using the given parameters.
 
Method Summary
 int getEndIndex()
          This returns the index within the input string where the match in its entirety ends.
 int getStartIndex()
          This returns the index within the input text where the match in its entirety began.
 java.lang.String toString()
          This returns the String matching the regular expression pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Match

public Match(int aStart,
             int anEnd,
             java.lang.String anImage)
This creates a new instance of Match using the given parameters.

Parameters:
aStart - an int with the start index
anEnd - an int with the end index
anImage - a String with the match
Method Detail

getStartIndex

public int getStartIndex()
This returns the index within the input text where the match in its entirety began.

Returns:
a int

getEndIndex

public int getEndIndex()
This returns the index within the input string where the match in its entirety ends. The return value is the next position after the end of the string.

Returns:
an int with the index

toString

public java.lang.String toString()
This returns the String matching the regular expression pattern.

Returns:
the matching String