X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=unused%2Fcom%2Fstevesoft%2Fpat%2FBackRefRule.java;fp=unused%2Fcom%2Fstevesoft%2Fpat%2FBackRefRule.java;h=a2ae3f98d557db73eeacb67491c35e6687bdd6f4;hb=6319110ce33faa76ee6cf9832e78faa224510fed;hp=28d4c3c428693b5d2af5750658ae44b1053af60d;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44;p=jalviewjs.git diff --git a/unused/com/stevesoft/pat/BackRefRule.java b/unused/com/stevesoft/pat/BackRefRule.java index 28d4c3c..a2ae3f9 100644 --- a/unused/com/stevesoft/pat/BackRefRule.java +++ b/unused/com/stevesoft/pat/BackRefRule.java @@ -1,40 +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.appendStr(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.appendStr(x == null ? "" : x); + } + + public String toString1() + { + return "$" + n; + } + + public Object clone1() + { + return new BackRefRule(n); + } +}