2 // This software is now distributed according to
\r
3 // the Lesser Gnu Public License. Please see
\r
4 // http://www.gnu.org/copyleft/lesser.txt for
\r
6 // -- Happy Computing!
\r
11 /** A tool that is used to make the \E, \U, \L, and \Q
\r
12 elements of a substitution. */
\r
13 public class StringBufferLike implements BasicStringBufferLike {
\r
14 BasicStringBufferLike sbl;
\r
15 public StringBufferLike(BasicStringBufferLike sbl) {
\r
18 char mode = 'E', altMode = ' ';
\r
19 public StringLike toStringLike() {
\r
20 return sbl.toStringLike();
\r
22 public String toString() {
\r
23 return sbl.toString();
\r
25 public void append(char c) {
\r
32 sbl.append(CaseMgr.toUpperCase(c));
\r
38 sbl.append(CaseMgr.toLowerCase(c));
\r
41 if((c >= 'a' && c <= 'z')
\r
42 || (c >= 'A' && c <= 'Z')
\r
43 || (c >= '0' && c <= '9'))
\r
52 public void append(String s) {
\r
53 for(int i=0;i<s.length();i++)
\r
54 append(s.charAt(i));
\r
56 public void setMode(char c) {
\r
57 if(c == 'u' || c == 'l')
\r
58 if(altMode == ' ') altMode = mode;
\r
61 public Object unwrap() {
\r
62 return sbl.unwrap();
\r