JAL-1211 - pick up site-defined defined window geometry before we calculate layout
[jalview.git] / src / com / stevesoft / pat / Backup.java
index df480ea..1986460 100755 (executable)
@@ -1,27 +1,54 @@
-//\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
-import java.util.Hashtable;\r
-\r
-/** Implements the (?<number) Pattern, where number is\r
- an integer telling us how far to back up in the Pattern.\r
- Not in perl 5. It also allows (?>number). */\r
-class Backup extends Pattern {\r
-    int bk;\r
-    Backup(int ii) { bk = ii; }\r
-    public String toString() {\r
-        return "(?" + (bk < 0 ? ">" + (-bk) : "<" + bk) + ")" + nextString();\r
-    }\r
-    public int matchInternal(int pos,Pthings pt) {\r
-        if(pos < bk) return -1;\r
-        return nextMatch(pos-bk,pt);\r
-    }\r
-    public patInt minChars() { return new patInt(-bk); }\r
-    public patInt maxChars() { return new patInt(-bk); }\r
-    public Pattern clone1(Hashtable h) { return new Backup(bk); }\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;
+
+import java.util.*;
+
+/**
+ * Implements the (?&lt;number) Pattern, where number is an integer telling us
+ * how far to back up in the Pattern. Not in perl 5. It also allows
+ * (?&gt;number).
+ */
+class Backup extends Pattern
+{
+  int bk;
+
+  Backup(int ii)
+  {
+    bk = ii;
+  }
+
+  public String toString()
+  {
+    return "(?" + (bk < 0 ? ">" + (-bk) : "<" + bk) + ")" + nextString();
+  }
+
+  public int matchInternal(int pos, Pthings pt)
+  {
+    if (pos < bk)
+    {
+      return -1;
+    }
+    return nextMatch(pos - bk, pt);
+  }
+
+  public patInt minChars()
+  {
+    return new patInt(-bk);
+  }
+
+  public patInt maxChars()
+  {
+    return new patInt(-bk);
+  }
+
+  public Pattern clone1(Hashtable h)
+  {
+    return new Backup(bk);
+  }
+};