35 |
obligated to do so. If you do not wish to do so, delete this |
obligated to do so. If you do not wish to do so, delete this |
36 |
exception statement from your version. */ |
exception statement from your version. */ |
37 |
|
|
38 |
// Stub class until java.util.regex is implemented. |
|
39 |
package java.util.regex; |
package java.util.regex; |
40 |
|
|
41 |
|
/** |
42 |
|
* @author Michael Koch |
43 |
|
* @since 1.4 |
44 |
|
*/ |
45 |
public class Matcher |
public class Matcher |
46 |
{ |
{ |
47 |
public String replaceFirst(String replacement) |
private Pattern pattern; |
48 |
|
|
49 |
|
/** |
50 |
|
* @param sb The target string buffer |
51 |
|
* @param replacement The replacement string |
52 |
|
* |
53 |
|
* @exception IllegalStateException If no match has yet been attempted, |
54 |
|
* or if the previous match operation failed |
55 |
|
* @exception IndexOutOfBoundsException If the replacement string refers |
56 |
|
* to a capturing group that does not exist in the pattern |
57 |
|
*/ |
58 |
|
public Matcher appendReplacement (StringBuffer sb, String replacement) |
59 |
|
throws IllegalStateException |
60 |
|
{ |
61 |
|
throw new Error("Not implemented"); |
62 |
|
} |
63 |
|
|
64 |
|
/** |
65 |
|
* @param sb The target string buffer |
66 |
|
*/ |
67 |
|
public StringBuffer appendTail (StringBuffer sb) |
68 |
|
{ |
69 |
|
throw new Error("Not implemented"); |
70 |
|
} |
71 |
|
|
72 |
|
/** |
73 |
|
* @exception IllegalStateException If no match has yet been attempted, |
74 |
|
* or if the previous match operation failed |
75 |
|
*/ |
76 |
|
public int end () |
77 |
|
throws IllegalStateException |
78 |
|
{ |
79 |
|
throw new Error ("Not implemented"); |
80 |
|
} |
81 |
|
|
82 |
|
/** |
83 |
|
* @param group The index of a capturing group in this matcher's pattern |
84 |
|
* |
85 |
|
* @exception IllegalStateException If no match has yet been attempted, |
86 |
|
* or if the previous match operation failed |
87 |
|
* @exception IndexOutOfBoundsException If the replacement string refers |
88 |
|
* to a capturing group that does not exist in the pattern |
89 |
|
*/ |
90 |
|
public int end (int group) |
91 |
|
throws IllegalStateException |
92 |
|
{ |
93 |
|
throw new Error ("Not implemented"); |
94 |
|
} |
95 |
|
|
96 |
|
public boolean find () |
97 |
|
{ |
98 |
|
throw new Error ("Not implemented"); |
99 |
|
} |
100 |
|
|
101 |
|
/** |
102 |
|
* @param start The index to start the new pattern matching |
103 |
|
* |
104 |
|
* @exception IndexOutOfBoundsException If the replacement string refers |
105 |
|
* to a capturing group that does not exist in the pattern |
106 |
|
*/ |
107 |
|
public boolean find (int start) |
108 |
|
{ |
109 |
|
throw new Error ("Not implemented"); |
110 |
|
} |
111 |
|
|
112 |
|
/** |
113 |
|
* @exception IllegalStateException If no match has yet been attempted, |
114 |
|
* or if the previous match operation failed |
115 |
|
*/ |
116 |
|
public String group () |
117 |
|
{ |
118 |
|
throw new Error ("Not implemented"); |
119 |
|
} |
120 |
|
|
121 |
|
/** |
122 |
|
* @param group The index of a capturing group in this matcher's pattern |
123 |
|
* |
124 |
|
* @exception IllegalStateException If no match has yet been attempted, |
125 |
|
* or if the previous match operation failed |
126 |
|
* @exception IndexOutOfBoundsException If the replacement string refers |
127 |
|
* to a capturing group that does not exist in the pattern |
128 |
|
*/ |
129 |
|
public String group (int group) |
130 |
|
throws IllegalStateException |
131 |
|
{ |
132 |
|
throw new Error ("Not implemented"); |
133 |
|
} |
134 |
|
|
135 |
|
/** |
136 |
|
* @param replacement The replacement string |
137 |
|
*/ |
138 |
|
public String replaceFirst (String replacement) |
139 |
{ |
{ |
140 |
throw new InternalError("Not implemented yet"); |
throw new Error ("Not implemented"); |
141 |
} |
} |
142 |
public String replaceAll(String replacement) |
|
143 |
|
/** |
144 |
|
* @param replacement The replacement string |
145 |
|
*/ |
146 |
|
public String replaceAll (String replacement) |
147 |
|
{ |
148 |
|
throw new Error ("Not implemented"); |
149 |
|
} |
150 |
|
|
151 |
|
public int groupCount () |
152 |
|
{ |
153 |
|
throw new Error("Not implemented"); |
154 |
|
} |
155 |
|
|
156 |
|
public boolean lookingAt () |
157 |
|
{ |
158 |
|
throw new Error("Not implemented"); |
159 |
|
} |
160 |
|
|
161 |
|
/** |
162 |
|
* Attempts to match the entire input sequence against the pattern. |
163 |
|
* |
164 |
|
* If the match succeeds then more information can be obtained via the |
165 |
|
* start, end, and group methods. |
166 |
|
* |
167 |
|
* @see #start |
168 |
|
* @see #end |
169 |
|
* @see #group |
170 |
|
*/ |
171 |
|
public boolean matches () |
172 |
|
{ |
173 |
|
throw new Error("Not implemented"); |
174 |
|
} |
175 |
|
|
176 |
|
/** |
177 |
|
* Returns the Pattern that is interpreted by this Matcher |
178 |
|
*/ |
179 |
|
public Pattern pattern () |
180 |
|
{ |
181 |
|
return pattern; |
182 |
|
} |
183 |
|
|
184 |
|
public Matcher reset () |
185 |
|
{ |
186 |
|
throw new Error ("Not implemented"); |
187 |
|
} |
188 |
|
|
189 |
|
/** |
190 |
|
* @param input The new input character sequence |
191 |
|
*/ |
192 |
|
public Matcher reset (CharSequence input) |
193 |
|
{ |
194 |
|
throw new Error ("Not implemented"); |
195 |
|
} |
196 |
|
|
197 |
|
/** |
198 |
|
* @param group The index of a capturing group in this matcher's pattern |
199 |
|
* |
200 |
|
* @exception IllegalStateException If no match has yet been attempted, |
201 |
|
* or if the previous match operation failed |
202 |
|
*/ |
203 |
|
public int start () |
204 |
|
throws IllegalStateException |
205 |
|
{ |
206 |
|
throw new Error("Not implemented"); |
207 |
|
} |
208 |
|
|
209 |
|
/** |
210 |
|
* @param group The index of a capturing group in this matcher's pattern |
211 |
|
* |
212 |
|
* @exception IllegalStateException If no match has yet been attempted, |
213 |
|
* or if the previous match operation failed |
214 |
|
* @exception IndexOutOfBoundsException If the replacement string refers |
215 |
|
* to a capturing group that does not exist in the pattern |
216 |
|
*/ |
217 |
|
public int start (int group) |
218 |
|
throws IllegalStateException |
219 |
{ |
{ |
220 |
throw new InternalError("Not implemented yet"); |
throw new Error("Not implemented"); |
221 |
} |
} |
222 |
} |
} |