JAL-1807 Bob's first commit -- Applet loaded; needs image
[jalview.git] / src / com / stevesoft / pat / RegRes.java
index a204c47..83a6c62 100755 (executable)
@@ -14,7 +14,7 @@ package com.stevesoft.pat;
 /**
  * This class is used to store a result from Regex
  */
-public class RegRes implements Cloneable
+public class RegRes
 {
   protected int[] marks = null;
 
@@ -48,20 +48,20 @@ public class RegRes implements Cloneable
     {
       int n = i + 1;
       sb
-              .append(" sub(" + n + ")=" + matchedFrom(n) + ":"
-                      + charsMatched(n));
+              .append(" sub(" + n + ")=" + matchedFromI(n) + ":"
+                      + charsMatchedI(n));
     }
     return sb.toString();
   }
 
-  public RegRes()
-  {
-  }
-
-  public RegRes(RegRes r)
-  {
-    copyOutOf(r);
-  }
+//  public RegRes()
+//  {
+//  }
+//
+//  public RegRes(RegRes r)
+//  {
+//    copyOutOf(r);
+//  }
 
   public void copyOutOf(RegRes r)
   {
@@ -91,11 +91,11 @@ public class RegRes implements Cloneable
     numSubs_ = r.numSubs_;
   }
 
-  public Object clone()
-  {
-    return new RegRes(this);
-  }
-
+//  public Object clone()
+//  {
+//    return new RegRes(this);
+//  }
+//
   public boolean equals(RegRes r)
   {
     if (charsMatched_ != r.charsMatched_ || matchFrom_ != r.matchFrom_
@@ -114,11 +114,11 @@ public class RegRes implements Cloneable
     }
     for (int i = 1; i <= numSubs_; i++)
     {
-      if (matchedFrom(i) != r.matchedFrom(i))
+      if (matchedFromI(i) != r.matchedFromI(i))
       {
         return false;
       }
-      else if (charsMatched(i) != r.charsMatched(i))
+      else if (charsMatchedI(i) != r.charsMatchedI(i))
       {
         return false;
       }
@@ -138,7 +138,7 @@ public class RegRes implements Cloneable
    * Obtains the position backreference number i begins to match, or -1 if
    * backreference i was not matched.
    */
-  public int matchedFrom(int i)
+  public int matchedFromI(int i)
   {
     if (marks == null || i > numSubs_)
     {
@@ -153,7 +153,7 @@ public class RegRes implements Cloneable
    * Obtains the number of characters matched by backreference i, or -1 if
    * backreference i was not matched.
    */
-  public int charsMatched(int i)
+  public int charsMatchedI(int i)
   {
     if (marks == null || i > numSubs_ || !didMatch_)
     {
@@ -161,15 +161,15 @@ public class RegRes implements Cloneable
     }
     // Integer in = (Integer)marks.get("right"+i);
     // int i2 = in==null ? -1 : in.intValue();
-    int mf = matchedFrom(i);
-    return mf < 0 ? -1 : marks[i + numSubs_] - matchedFrom(i);
+    int mf = matchedFromI(i);
+    return mf < 0 ? -1 : marks[i + numSubs_] - matchedFromI(i);
   }
 
   /**
    * This is either equal to matchedFrom(i)+charsMatched(i) if the match was
    * successful, or -1 if it was not.
    */
-  public int matchedTo(int i)
+  public int matchedToI(int i)
   {
     if (marks == null || i > numSubs_ || !didMatch_)
     {
@@ -182,9 +182,9 @@ public class RegRes implements Cloneable
    * Obtains a substring matching the nth set of parenthesis from the pattern.
    * See numSubs(void), or null if the nth backrefence did not match.
    */
-  public String stringMatched(int i)
+  public String stringMatchedI(int i)
   {
-    int mf = matchedFrom(i), cm = charsMatched(i);
+    int mf = matchedFromI(i), cm = charsMatchedI(i);
     return !didMatch_ || mf < 0 || cm < 0 ? null : src.substring(mf, mf
             + cm);
   }
@@ -203,9 +203,9 @@ public class RegRes implements Cloneable
    * This returns the part of the string that follows the ith backreference, or
    * null if the backreference did not match.
    */
-  public String left(int i)
+  public String leftI(int i)
   {
-    int mf = matchedFrom(i);
+    int mf = matchedFromI(i);
     return !didMatch_ || (mf < 0) ? null : src.substring(0, mf);
   }
 
@@ -224,9 +224,9 @@ public class RegRes implements Cloneable
    * This returns the string to the right of the ith backreference, or null if
    * the backreference did not match.
    */
-  public String right(int i)
+  public String rightI(int i)
   {
-    int mf = matchedFrom(i), cm = charsMatched(i);
+    int mf = matchedFromI(i), cm = charsMatchedI(i);
     return !didMatch_ || mf < 0 || cm < 0 ? null : src.substring(mf + cm,
             src.length());
   }
@@ -286,14 +286,14 @@ public class RegRes implements Cloneable
   }
 
   /** An older name for matchedFrom. */
-  public int matchFrom(int i)
+  public int matchFromI(int i)
   {
-    return matchedFrom(i);
+    return matchedFromI(i);
   }
 
   /** An older name for stringMatched. */
-  public String substring(int i)
+  public String substringI(int i)
   {
-    return stringMatched(i);
+    return stringMatchedI(i);
   }
 }