Class | Line # | Actions | |||
---|---|---|---|---|---|
CustomEndpoint | 16 | 7 | 5 |
1 | // | |
2 | // This software is now distributed according to | |
3 | // the Lesser Gnu Public License. Please see | |
4 | // http://www.gnu.org/copyleft/lesser.txt for | |
5 | // the details. | |
6 | // -- Happy Computing! | |
7 | // | |
8 | package com.stevesoft.pat; | |
9 | ||
10 | import java.util.Hashtable; | |
11 | ||
12 | /** | |
13 | * This class is needed internally to make backtracking work correctly in | |
14 | * user-defined patterns. | |
15 | */ | |
16 | class CustomEndpoint extends Pattern | |
17 | { | |
18 | Custom c; | |
19 | ||
20 | 0 | CustomEndpoint(Custom cm) |
21 | { | |
22 | 0 | c = cm; |
23 | } | |
24 | ||
25 | 0 | public int matchInternal(int pos, Pthings pt) |
26 | { | |
27 | 0 | int npos = c.v.validate(pt.src, c.start, pos); |
28 | 0 | if (npos >= 0) |
29 | { | |
30 | 0 | return nextMatch(npos, pt); |
31 | } | |
32 | 0 | return -1; |
33 | } | |
34 | ||
35 | 0 | public String toString() |
36 | { | |
37 | 0 | return ""; |
38 | } | |
39 | ||
40 | 0 | Pattern clone1(Hashtable h) |
41 | { | |
42 | 0 | return new CustomEndpoint((Custom) c.clone(h)); |
43 | } | |
44 | } |