-//\r
-// This software is now distributed according to\r
-// the Lesser Gnu Public License. Please see\r
-// http://www.gnu.org/copyleft/lesser.txt for\r
-// the details.\r
-// -- Happy Computing!\r
-//\r
-package com.stevesoft.pat;\r
-\r
-/** This method implements the pattern elements $1, $2, etc in\r
- a substitution rule. The apply(StringBufferLike sb,RegRes rr) method of this ReplaceRule\r
- simply appends the contents of rr.stringMatched(n), where n is\r
- the integer supplied to the constructor. */\r
-public class BackRefRule\r
- extends ReplaceRule\r
-{\r
- int n;\r
- public BackRefRule(int n)\r
- {\r
- this.n = n;\r
- }\r
-\r
- public void apply(StringBufferLike sb, RegRes res)\r
- {\r
- String x = res.stringMatched(n);\r
- sb.append(x == null ? "" : x);\r
- }\r
-\r
- public String toString1()\r
- {\r
- return "$" + n;\r
- }\r
-\r
- public Object clone1()\r
- {\r
- return new BackRefRule(n);\r
- }\r
-}\r
+//
+// This software is now distributed according to
+// the Lesser Gnu Public License. Please see
+// http://www.gnu.org/copyleft/lesser.txt for
+// the details.
+// -- Happy Computing!
+//
+package com.stevesoft.pat;
+
+/**
+ * This method implements the pattern elements $1, $2, etc in a substitution
+ * rule. The apply(StringBufferLike sb,RegRes rr) method of this ReplaceRule
+ * simply appends the contents of rr.stringMatched(n), where n is the integer
+ * supplied to the constructor.
+ */
+public class BackRefRule extends ReplaceRule
+{
+ int n;
+
+ public BackRefRule(int n)
+ {
+ this.n = n;
+ }
+
+ public void apply(StringBufferLike sb, RegRes res)
+ {
+ String x = res.stringMatched(n);
+ sb.append(x == null ? "" : x);
+ }
+
+ public String toString1()
+ {
+ return "$" + n;
+ }
+
+ public Object clone1()
+ {
+ return new BackRefRule(n);
+ }
+}