JAL-4090 JAL-1551 spotlessApply
[jalview.git] / src / jalview / datamodel / ContactMatrix.java
index 2e12a91..b01dd6c 100644 (file)
@@ -6,7 +6,8 @@ import java.util.StringTokenizer;
 
 import jalview.bin.Console;
 
-public abstract class ContactMatrix extends GroupSetHolder implements ContactMatrixI
+public abstract class ContactMatrix extends GroupSetHolder
+        implements ContactMatrixI
 {
   /**
    * are contacts reflexive ?
@@ -112,9 +113,10 @@ public abstract class ContactMatrix extends GroupSetHolder implements ContactMat
       }
     });
   }
+
   private Float getFloatElementAt(int column, int p)
   {
-    
+
     List<Float> clist;
     Float cl = null;
     if (symmetric)
@@ -137,16 +139,18 @@ public abstract class ContactMatrix extends GroupSetHolder implements ContactMat
     }
     return cl;
   }
+
   @Override
   public double getElementAt(int column, int row)
   {
     Float cl = getFloatElementAt(column, row);
-    if (cl!=null)
+    if (cl != null)
     {
       return cl;
     }
-    throw(new RuntimeException("Out of Bounds "+column+","+row));
+    throw (new RuntimeException("Out of Bounds " + column + "," + row));
   }
+
   @Override
   public float getMin()
   {
@@ -170,25 +174,28 @@ public abstract class ContactMatrix extends GroupSetHolder implements ContactMat
   {
     return "Contact Matrix";
   }
+
   public static String contactToFloatString(ContactMatrixI cm)
   {
     StringBuilder sb = new StringBuilder();
     for (int c = 0; c < cm.getWidth(); c++)
     {
       ContactListI cl = cm.getContactList(c);
-      long lastsb=-1;
+      long lastsb = -1;
       if (cl != null)
       {
         for (int h = 0; h <= cl.getContactHeight(); h++)
         {
           if (sb.length() > 0)
           {
-            if (sb.length()-lastsb>320)
+            if (sb.length() - lastsb > 320)
             {
               // newline
               sb.append('\n');
-              lastsb=sb.length();
-            } else {
+              lastsb = sb.length();
+            }
+            else
+            {
               sb.append('\t');
             }
           }
@@ -203,7 +210,7 @@ public abstract class ContactMatrix extends GroupSetHolder implements ContactMat
           int rows)
   {
     float[][] vals = new float[cols][rows];
-    StringTokenizer tabsep = new StringTokenizer(values, "" + '\t'+'\n');
+    StringTokenizer tabsep = new StringTokenizer(values, "" + '\t' + '\n');
     int c = 0, r = 0;
     while (tabsep.hasMoreTokens())
     {