JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / unused / com / stevesoft / pat / CodeRule.java
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 /** Implements the rules for \U, \L, \E, \Q in substitutions. */
11 public final class CodeRule extends SpecialRule
12 {
13   char c = 'E';
14
15   public CodeRule()
16   {
17   }
18
19   public CodeRule(char c)
20   {
21     this.c = c;
22   }
23
24   public void apply(StringBufferLike sb, RegRes res)
25   {
26     sb.setMode(c);
27   }
28
29   public String toString1()
30   {
31     return "\\" + c;
32   }
33 }