X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fcom%2Fstevesoft%2Fpat%2FBackRefRule.java;h=daacbc1fad44ab98e5ed02211d199b1fcf64a7c2;hb=236b7a125d995a097de4ee42d022320f382e7027;hp=8488ba3710a97f432a41fe3513f47273341e1dbc;hpb=7bc226b58110fa26d9dbd3f0c78095d06909ffc3;p=jalview.git diff --git a/src/com/stevesoft/pat/BackRefRule.java b/src/com/stevesoft/pat/BackRefRule.java index 8488ba3..daacbc1 100755 --- a/src/com/stevesoft/pat/BackRefRule.java +++ b/src/com/stevesoft/pat/BackRefRule.java @@ -1,38 +1,40 @@ -// -// 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); - } -} +// +// 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); + } +}