toString method added to aid viewing in the debugger
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 4 Jun 2015 13:43:53 +0000 (14:43 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 4 Jun 2015 13:43:53 +0000 (14:43 +0100)
src/jalview/util/MapList.java

index 2641659..662240e 100644 (file)
@@ -859,4 +859,26 @@ public class MapList
               .getToHighest()));
     }
   }
+
+  /**
+   * String representation - for debugging, not guaranteed not to change
+   */
+  @Override
+  public String toString()
+  {
+    StringBuilder sb = new StringBuilder(64);
+    sb.append("From (").append(fromRatio).append(":").append(toRatio)
+            .append(") [");
+    for (int[] shift : fromShifts)
+    {
+      sb.append(" ").append(Arrays.toString(shift));
+    }
+    sb.append(" ] To [");
+    for (int[] shift : toShifts)
+    {
+      sb.append(" ").append(Arrays.toString(shift));
+    }
+    sb.append(" ]");
+    return sb.toString();
+  }
 }