Class | Line # | Actions | |||
---|---|---|---|---|---|
ChangeRule | 16 | 7 | 6 |
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 | /** | |
11 | * This class implements user defined special replacement rules of the form | |
12 | * ${=name}. See | |
13 | * <a href="http://javaregex.com/code/trans2.java.html">trans2.java</a> and | |
14 | * <a href="http://javaregex.com/code/trans2a.java.html">trans2a.java</a>. | |
15 | */ | |
16 | public class ChangeRule extends SpecialRule | |
17 | { | |
18 | Regex NewRule; | |
19 | ||
20 | 0 | public ChangeRule(ChangeRule c) |
21 | { | |
22 | 0 | NewRule = c.NewRule; |
23 | } | |
24 | ||
25 | 0 | public ChangeRule(String nm, Regex rr) |
26 | { | |
27 | 0 | name = nm; |
28 | 0 | NewRule = rr; |
29 | } | |
30 | ||
31 | 0 | public ChangeRule(String nm, Transformer tr) |
32 | { | |
33 | 0 | name = nm; |
34 | 0 | NewRule = tr.rp; |
35 | } | |
36 | ||
37 | 0 | public Object clone1() |
38 | { | |
39 | 0 | return new ChangeRule(this); |
40 | } | |
41 | ||
42 | 0 | public String toString1() |
43 | { | |
44 | 0 | return "${=" + name + "}"; |
45 | } | |
46 | ||
47 | 0 | public void apply(StringBufferLike sb, RegRes rr) |
48 | { | |
49 | } | |
50 | } |