| Class | Line # | Actions | |||
|---|---|---|---|---|---|
| StringRule | 16 | 4 | 4 |
| 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 | * The apply method of this ReplaceRule simply appends the text it was | |
| 12 | * initialized with to the StringBufferLike. | |
| 13 | * | |
| 14 | * @see com.stevesoft.pat.ReplaceRule | |
| 15 | */ | |
| 16 | public class StringRule extends ReplaceRule | |
| 17 | { | |
| 18 | String s; | |
| 19 | ||
| 20 | 0 | public StringRule(String s) |
| 21 | { | |
| 22 | 0 | this.s = s; |
| 23 | } | |
| 24 | ||
| 25 | 0 | public void apply(StringBufferLike sb, RegRes res) |
| 26 | { | |
| 27 | 0 | sb.append(s); |
| 28 | } | |
| 29 | ||
| 30 | 0 | public String toString1() |
| 31 | { | |
| 32 | 0 | return s; |
| 33 | } | |
| 34 | ||
| 35 | 0 | public Object clone1() |
| 36 | { | |
| 37 | 0 | return new StringRule(s); |
| 38 | } | |
| 39 | } |