JAL-1645 Version-Rel Version 2.9 Year-Rel 2015 Licensing glob
[jalview.git] / src / jalview / datamodel / CigarBase.java
index 1506cee..0dfa84d 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
+ * Copyright (C) 2015 The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -22,7 +22,7 @@ package jalview.datamodel;
 
 import jalview.util.MessageManager;
 
-import java.util.*;
+import java.util.Vector;
 
 public abstract class CigarBase
 {
@@ -101,8 +101,7 @@ public abstract class CigarBase
       case D:
         if (!consecutive_del)
         {
-          deletions[++delcount] = new int[]
-          { cursor, 0, alcursor };
+          deletions[++delcount] = new int[] { cursor, 0, alcursor };
         }
         cursor += range[i];
         deletions[delcount][1] = cursor - 1;
@@ -146,7 +145,9 @@ public abstract class CigarBase
         endpos = alcursor;
         break;
       default:
-        throw new Error(MessageManager.formatMessage("error.unknown_seq_cigar_operation", new String[]{new StringBuffer(operation[i]).toString()}));
+        throw new Error(MessageManager.formatMessage(
+                "error.unknown_seq_cigar_operation",
+                new String[] { new StringBuffer(operation[i]).toString() }));
       }
     }
     if (++delcount > 0)
@@ -155,9 +156,8 @@ public abstract class CigarBase
       System.arraycopy(deletions, 0, trunc_deletions, 0, delcount);
     }
     deletions = null;
-    return new Object[]
-    { ((reference != null) ? sq.toString() : null), new int[]
-    { start, startpos, end, endpos }, trunc_deletions };
+    return new Object[] { ((reference != null) ? sq.toString() : null),
+        new int[] { start, startpos, end, endpos }, trunc_deletions };
   }
 
   protected void compact_operations()
@@ -225,7 +225,9 @@ public abstract class CigarBase
       } while (c >= '0' && c <= '9' && j < l);
       if (j >= l && c >= '0' && c <= '9')
       {
-        throw new Exception(MessageManager.getString("exception.unterminated_cigar_string"));
+        throw new Exception(
+                MessageManager
+                        .getString("exception.unterminated_cigar_string"));
       }
       try
       {
@@ -234,7 +236,9 @@ public abstract class CigarBase
         i = j;
       } catch (Exception e)
       {
-        throw new Error(MessageManager.getString("error.implementation_bug_parse_cigar_string"));
+        throw new Error(
+                MessageManager
+                        .getString("error.implementation_bug_parse_cigar_string"));
       }
       if (c >= 'a' && c <= 'z')
       {
@@ -246,15 +250,13 @@ public abstract class CigarBase
       }
       else
       {
-        throw new Exception(MessageManager.formatMessage("exception.unexpected_operation_cigar_string_pos", new String[]{
-                       new StringBuffer(c).toString(),
-                       Integer.valueOf(i).toString(),
-                       cigarString
-        }));
+        throw new Exception(MessageManager.formatMessage(
+                "exception.unexpected_operation_cigar_string_pos",
+                new String[] { new StringBuffer(c).toString(),
+                    Integer.valueOf(i).toString(), cigarString }));
       }
     }
-    return new Object[]
-    { operation, range };
+    return new Object[] { operation, range };
   }
 
   /**
@@ -273,7 +275,9 @@ public abstract class CigarBase
     }
     if (op != M && op != D && op != I)
     {
-      throw new Error(MessageManager.getString("error.implementation_error_invalid_operation_string"));
+      throw new Error(
+              MessageManager
+                      .getString("error.implementation_error_invalid_operation_string"));
     }
     if (range == 0)
     {
@@ -281,7 +285,8 @@ public abstract class CigarBase
     }
     if (range < 0)
     {
-      throw new Error(MessageManager.getString("error.invalid_range_string"));
+      throw new Error(
+              MessageManager.getString("error.invalid_range_string"));
     }
     int lngth = 0;
     if (operation == null)
@@ -393,7 +398,9 @@ public abstract class CigarBase
     }
     if (start < 0 || start > end)
     {
-      throw new Error(MessageManager.getString("error.implementation_error_delete_range_out_of_bounds"));
+      throw new Error(
+              MessageManager
+                      .getString("error.implementation_error_delete_range_out_of_bounds"));
     }
     // find beginning
     int cursor = 0; // mark the position for the current operation being edited.
@@ -465,9 +472,13 @@ public abstract class CigarBase
           }
           break;
         case D:
-          throw new Error(MessageManager.getString("error.implementation_error")); // do nothing;
+          throw new Error(
+                  MessageManager.getString("error.implementation_error")); // do
+                                                                           // nothing;
         default:
-          throw new Error(MessageManager.formatMessage("error.implementation_error_unknown_operation", new String[]{new StringBuffer(oldops[o]).toString()}));
+          throw new Error(MessageManager.formatMessage(
+                  "error.implementation_error_unknown_operation",
+                  new String[] { new StringBuffer(oldops[o]).toString() }));
         }
         rlength -= remain;
         remain = oldrange[++o]; // number of op characters left to edit
@@ -526,8 +537,7 @@ public abstract class CigarBase
         vcursor += range[i];
         break;
       case D:
-        dr.addElement(new int[]
-        { vcursor, cursor, range[i] });
+        dr.addElement(new int[] { vcursor, cursor, range[i] });
         cursor += range[i];
       }
     }