JAL-4090 JAL-1551 spotlessApply
[jalview.git] / src / jalview / ws / datamodel / alphafold / MappableContactMatrix.java
index 5f27a2c..c299a4d 100644 (file)
@@ -21,8 +21,8 @@ public abstract class MappableContactMatrix<T extends MappableContactMatrix<T>>
   /**
    * the matrix that is being mapped to
    */
-  protected ContactMatrixI mappedMatrix=null;
-  
+  protected ContactMatrixI mappedMatrix = null;
+
   public ContactListI getContactList(int column)
   {
     return mappedMatrix.getContactList(column);
@@ -53,7 +53,7 @@ public abstract class MappableContactMatrix<T extends MappableContactMatrix<T>>
   {
     return mappedMatrix;
   }
-  
+
   @Override
   public GroupSetI getGroupSet()
   {
@@ -65,7 +65,7 @@ public abstract class MappableContactMatrix<T extends MappableContactMatrix<T>>
   {
     mappedMatrix.setGroupSet(makeGroups);
   }
-  
+
   /**
    * the sequence and how it is mapped to the matrix
    */
@@ -254,9 +254,9 @@ public abstract class MappableContactMatrix<T extends MappableContactMatrix<T>>
               + "' is not mappable for the given localFrame sequence. ("
               + localFrame.getName() + ")");
     }
-    
+
     // now look up from-to matrix columns in toSeq frame
-    
+
     if (toSeq == null)
     {
       // no mapping - so we assume 1:1
@@ -266,33 +266,33 @@ public abstract class MappableContactMatrix<T extends MappableContactMatrix<T>>
     // first locate on reference sequence
 
     int[] mappedPositions = toSeq.locateInFrom(from, to);
-    if (mappedPositions==null)
+    if (mappedPositions == null)
     {
       return null;
     }
-    
+
     // and now map to localFrame
     // from-to columns on the associated sequence should be
     // i. restricted to positions in localFrame
-    // ii. 
-
-//    int s = -1, e = -1;
-//    for (int p = 0; p < mappedPositions.length; p++)
-//    {
-//      if (s == -1 && mappedPositions[p] >= localFrame.getStart())
-//      {
-//        s = p; // remember first position within local frame
-//      }
-//      if (e == -1 || mappedPositions[p] <= localFrame.getEnd())
-//      {
-//        // update end pointer
-//        e = p;
-//        // compute local map
-//        mappedPositions[p] = localFrame.findIndex(mappedPositions[p]);
-//      }
-//    }
-//    int[] _trimmed = new int[e - s + 1];
-//    return _trimmed;
+    // ii.
+
+    // int s = -1, e = -1;
+    // for (int p = 0; p < mappedPositions.length; p++)
+    // {
+    // if (s == -1 && mappedPositions[p] >= localFrame.getStart())
+    // {
+    // s = p; // remember first position within local frame
+    // }
+    // if (e == -1 || mappedPositions[p] <= localFrame.getEnd())
+    // {
+    // // update end pointer
+    // e = p;
+    // // compute local map
+    // mappedPositions[p] = localFrame.findIndex(mappedPositions[p]);
+    // }
+    // }
+    // int[] _trimmed = new int[e - s + 1];
+    // return _trimmed;
     return mappedPositions;
   }
 
@@ -475,15 +475,16 @@ public abstract class MappableContactMatrix<T extends MappableContactMatrix<T>>
   }
 
   /**
-   * get a specific element of the underlying contact matrix in its data-local coordinates
-   * rather than the mapped frame. Implementations are allowed to throw
-   * RunTimeExceptions if _column/i are out of bounds
+   * get a specific element of the underlying contact matrix in its data-local
+   * coordinates rather than the mapped frame. Implementations are allowed to
+   * throw RunTimeExceptions if _column/i are out of bounds
    * 
    * @param _column
    * @param i
    * @return
    */
-  public double getElementAt(int _column, int i) {
+  public double getElementAt(int _column, int i)
+  {
     return mappedMatrix.getElementAt(_column, i);
   }