// -- Happy Computing!\r
//\r
package com.stevesoft.pat;\r
-import java.util.Hashtable;\r
+\r
+import java.util.*;\r
\r
/** This class is needed internally to make backtracking work\r
- * correctly in user-defined patterns.\r
- */\r
-class CustomEndpoint extends Pattern {\r
- Custom c;\r
- CustomEndpoint(Custom cm) { c = cm; }\r
- public int matchInternal(int pos,Pthings pt) {\r
- int npos = c.v.validate(pt.src,c.start,pos);\r
- if(npos >= 0) \r
- return nextMatch(npos,pt);\r
- return -1;\r
- }\r
- public String toString() { return ""; }\r
- Pattern clone1(Hashtable h) {\r
- return new CustomEndpoint((Custom)c.clone(h));\r
+ * correctly in user-defined patterns.\r
+ */\r
+class CustomEndpoint\r
+ extends Pattern\r
+{\r
+ Custom c;\r
+ CustomEndpoint(Custom cm)\r
+ {\r
+ c = cm;\r
+ }\r
+\r
+ public int matchInternal(int pos, Pthings pt)\r
+ {\r
+ int npos = c.v.validate(pt.src, c.start, pos);\r
+ if (npos >= 0)\r
+ {\r
+ return nextMatch(npos, pt);\r
}\r
+ return -1;\r
+ }\r
+\r
+ public String toString()\r
+ {\r
+ return "";\r
+ }\r
+\r
+ Pattern clone1(Hashtable h)\r
+ {\r
+ return new CustomEndpoint( (Custom) c.clone(h));\r
+ }\r
}\r