org.acmsl.regexpplugin.gnuregexp
Class MatchResultGNUAdapter

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

public class MatchResultGNUAdapter
extends java.lang.Object
implements MatchResult

Represents the result of match in a regexp parsing process using GNU Regexp 1.1.4 package.

Version:
$Revision: 1.4 $
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
MatchResultGNUAdapter(gnu.regexp.REMatch adaptee, int groups)
          Constructs a MatchResultGNUAdapter from given GNU Regexp 1.1.4 REMatch instance.
 
Method Summary
protected  gnu.regexp.REMatch 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 JDK1.4 javadoc: Returns the string matching the given subexpression.
 int groups()
          Taken from GNU Regexp 1.4 javadoc: Returns the maximum number of subexpressions in this regular expression.
protected  void setAdaptee(gnu.regexp.REMatch adaptee)
          Sets the adaptee.
protected  void setGroups(int groups)
          Sets the group count.
 
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

MatchResultGNUAdapter

public MatchResultGNUAdapter(gnu.regexp.REMatch adaptee,
                             int groups)
Constructs a MatchResultGNUAdapter from given GNU Regexp 1.1.4 REMatch instance.

Parameters:
adaptee - GNU Regexp 1.1.4 REMatch object to adapt.
groups - the group count.
Method Detail

setAdaptee

protected void setAdaptee(gnu.regexp.REMatch adaptee)
Sets the adaptee.

Parameters:
adaptee - the instance to adapt.

getAdaptee

protected gnu.regexp.REMatch getAdaptee()
Retrieves the adaptee.

Returns:
the instance to adapt.

group

public java.lang.String group(int group)
Taken from JDK1.4 javadoc: Returns the string matching the given subexpression. The subexpressions are indexed starting with one, not zero. That is, the subexpression identified by the first set of parentheses in a regular expression could be retrieved from an REMatch by calling match.toString(1).

Specified by:
group in interface MatchResult
Parameters:
group - Index of the subexpression.
Returns:
the group matched at given position.

groups

public int groups()
Taken from GNU Regexp 1.4 javadoc: Returns the maximum number of subexpressions in this regular expression.

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

setGroups

protected void setGroups(int groups)
Sets the group count.

Parameters:
groups - the number of groups.

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.