X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fcom%2Fstevesoft%2Fpat%2FBackRefRule.java;fp=src%2Fcom%2Fstevesoft%2Fpat%2FBackRefRule.java;h=8488ba3710a97f432a41fe3513f47273341e1dbc;hb=7bc226b58110fa26d9dbd3f0c78095d06909ffc3;hp=64a5d6efdbf542b567953beec9012f173e09b6b9;hpb=dd74fc4938723fe5ec48d4e5fdcfbe58ac42a48d;p=jalview.git diff --git a/src/com/stevesoft/pat/BackRefRule.java b/src/com/stevesoft/pat/BackRefRule.java index 64a5d6e..8488ba3 100755 --- a/src/com/stevesoft/pat/BackRefRule.java +++ b/src/com/stevesoft/pat/BackRefRule.java @@ -11,13 +11,28 @@ package com.stevesoft.pat; 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); } +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); + } }