org.acmsl.regexpplugin.jakartaoro
Class MatchResultOROAdapter

java.lang.Object
  |
  +--org.acmsl.regexpplugin.jakartaoro.MatchResultOROAdapter
All Implemented Interfaces:
MatchResult, org.acmsl.version.Versionable

public class MatchResultOROAdapter
extends java.lang.Object
implements MatchResult

Represents the result of match in a regexp parsing process using Jakarta ORO package.

Version:
$Revision: 1.6 $
Author:
Jose San Leandro Armend?riz

Field Summary
static org.acmsl.version.Version VERSION
          Concrete version object updated everytime it's checked-in in a CVS repository.
 
Constructor Summary
MatchResultOROAdapter(org.apache.oro.text.regex.MatchResult matchResult)
          Constructs a MatchResultOROAdapter from given Jakarta ORO-specific instance.
 
Method Summary
protected  org.apache.oro.text.regex.MatchResult getAdaptee()
          Retrieves the adaptee.
static org.acmsl.version.Version getClassVersion()
          Retrieves the current version of this class.
 org.acmsl.version.Version getVersion()
          Retrieves the current version of this object.
 java.lang.String group(int group)
          Taken from Jakarta ORO javadoc: Returns the contents of the parenthesized subgroups of a match, counting parentheses from left to right and starting from 1.
 int groups()
          Taken from Jakarta ORO 2.0.6 javadoc: The number of groups contained in the result.
protected  void setAdaptee(org.apache.oro.text.regex.MatchResult adaptee)
          Sets the adaptee.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final org.acmsl.version.Version VERSION
Concrete version object updated everytime it's checked-in in a CVS repository.

Constructor Detail

MatchResultOROAdapter

public MatchResultOROAdapter(org.apache.oro.text.regex.MatchResult matchResult)
Constructs a MatchResultOROAdapter from given Jakarta ORO-specific instance.

Parameters:
matchResult - Jakarta ORO match result object to adapt.
Method Detail

setAdaptee

protected void setAdaptee(org.apache.oro.text.regex.MatchResult adaptee)
Sets the adaptee.

Parameters:
adaptee - the instance to adapt.

getAdaptee

protected org.apache.oro.text.regex.MatchResult getAdaptee()
Retrieves the adaptee.

Returns:
the adapted instance.

group

public java.lang.String group(int group)
Taken from Jakarta ORO javadoc: Returns the contents of the parenthesized subgroups of a match, counting parentheses from left to right and starting from 1. Group 0 always refers to the entire match. For example, if the pattern foo(\d+) is used to extract a match from the input abfoo123 , then group(0) will return foo123 and group(1) will return 123 . group(2) will return null because there is only one subgroup in the original pattern.

Specified by:
group in interface MatchResult
Parameters:
group - The pattern subgroup to return.
Returns:
A string containing the indicated pattern subgroup. Group 0 always refers to the entire match. If a group was never matched, it returns null. This is not to be confused with a group matching the null string, which will return a String of length 0.

groups

public int groups()
Taken from Jakarta ORO 2.0.6 javadoc: The number of groups contained in the result. This number includes the 0th group. In other words, the result refers to the number of parenthesized subgroups plus the entire match itself..

Specified by:
groups in interface MatchResult
Returns:
such value.

getVersion

public org.acmsl.version.Version getVersion()
Retrieves the current version of this object.

Specified by:
getVersion in interface org.acmsl.version.Versionable
Returns:
the version object with such information.

getClassVersion

public static org.acmsl.version.Version getClassVersion()
Retrieves the current version of this class.

Returns:
the object with class version information.


Copyright © 2003 ACM S.L.. All Rights Reserved.