1 /*
2 Java Regular Expressions Plugin API
3
4 Copyright (C) 2002 Jose San Leandro Armend?riz
5 jsanleandro@yahoo.es
6 chousz@yahoo.com
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
22 Thanks to ACM S.L. for distributing this library under the LGPL license.
23 Contact info: jsr000@terra.es
24 Postal Address: c/Playa de Lagoa, 1
25 Urb. Valdecaba?as
26 Boadilla del monte
27 28660 Madrid
28 Spain
29
30 This library uses some external APIs. So far I haven't released such
31 APIs as projects themselves, but you should be able
32 to download them from the web page where you got this source code.
33
34 ******************************************************************************
35 *
36 * Filename: $RCSfile: PatternGNUAdapter.java,v $
37 *
38 * Author: Jose San Leandro Armend?riz
39 *
40 * Description: Adapts GNU Regexp 1.1.4 RE objects to follow the
41 * generic Pattern interface defined in this API.
42 *
43 * Last modified by: $Author: dev $ at $Date: 2002/09/27 08:27:14 $
44 *
45 * File version: $Revision: 1.3 $
46 *
47 * Project version: $Name: $
48 * ("Name" means no concrete version has been checked out)
49 *
50 * $Id: PatternGNUAdapter.java,v 1.3 2002/09/27 08:27:14 dev Exp $
51 *
52 */
53 package org.acmsl.regexpplugin.gnuregexp;
54
55 /*
56 * Importing some project-specific classes.
57 */
58 import org.acmsl.regexpplugin.Pattern;
59
60 /*
61 * Importing some ACM classes.
62 */
63 import org.acmsl.version.Version;
64 import org.acmsl.version.VersionFactory;
65
66 /*
67 * Importing some JDK1.4 classes.
68 */
69 import gnu.regexp.RE;
70
71 /***
72 * Adapts GNU Regexp 1.1.4 RE objects to follow the generic
73 * Pattern interface defined in this API.
74 * @author <a href="mailto:jsanleandro@yahoo.es"
75 >Jose San Leandro Armend?riz</a>
76 * @version $Revision: 1.3 $
77 */
78 public class PatternGNUAdapter
79 implements Pattern
80 {
81 /***
82 * Delegated instance.
83 */
84 private RE m__Instance;
85
86 /***
87 * Constructs a PatternGNUAdapter for given object.
88 * @param adaptee the instance to be adapted.
89 */
90 public PatternGNUAdapter(RE adaptee)
91 {
92 setAdaptee(adaptee);
93 }
94
95 /***
96 * Sets the adaptee.
97 * @param adaptee the instance to adapt.
98 */
99 protected void setAdaptee(RE adaptee)
100 {
101 m__Instance = adaptee;
102 }
103
104 /***
105 * Retrieves the adapted instance of the RE class.
106 * Note: This method has package private access rights.
107 * @return such instance.
108 */
109 RE getDelegatedInstance()
110 {
111 return m__Instance;
112 }
113
114 /***
115 * Concrete version object updated everytime it's checked-in in a CVS
116 * repository.
117 */
118 public static final Version VERSION =
119 VersionFactory.createVersion("$Revision: 1.3 $");
120
121 /***
122 * Retrieves the current version of this object.
123 * @return the version object with such information.
124 */
125 public Version getVersion()
126 {
127 return VERSION;
128 }
129
130 /***
131 * Retrieves the current version of this class.
132 * @return the object with class version information.
133 */
134 public static Version getClassVersion()
135 {
136 return VERSION;
137 }
138 }
This page was automatically generated by Maven