JAL-1668 house keeping
[jalview.git] / src / jalview / ws / dbsources / PDBRestClient.java
index 1a80d65..039d23f 100644 (file)
@@ -148,10 +148,7 @@ public class PDBRestClient
                 .hasNext();)
         {
           JSONObject doc = docIter.next();
-          // if (doc.get("molecule_sequence") != null)
-          // {
           result.add(searchResult.new PDBResponseSummary(doc, pdbRestRequest));
-          // }
         }
         searchResult.setNumberOfItemsFound(numFound);
         searchResult.setResponseTime(queryTime);
@@ -161,13 +158,12 @@ public class PDBRestClient
     {
       e.printStackTrace();
     }
-
     return searchResult;
   }
 
   /**
-   * Takes a collection of PDBDocField and converts it into a comma delimited
-   * string.
+   * Takes a collection of PDBDocField and converts its code values into a comma
+   * delimited string.
    * 
    * @param pdbDocfields
    * @return
@@ -190,8 +186,9 @@ public class PDBRestClient
   }
 
   /**
-   * Determines the column index for the pdb id in the summary table. The pdb id
-   * serves as a unique identifier for a given row in the summary table
+   * Determines the column index for 'PDB Id' Fields in the dynamic summary
+   * table. The PDB Id serves as a unique identifier for a given row in the
+   * summary table
    * 
    * @param wantedFeilds
    *          the available table columns in no particular order
@@ -200,16 +197,18 @@ public class PDBRestClient
   public static int getPDBIdColumIndex(
           Collection<PDBDocField> wantedFeilds, boolean hasRefSeq)
   {
-    int pdbFeildIndex = hasRefSeq ? 1 : 0;
+    int pdbFeildIndexCounter = hasRefSeq ? 1 : 0; // If a reference sequence is
+                                           // attached then start counting from
+                                           // 1 else start from zero
     for (PDBDocField feild : wantedFeilds)
     {
       if (feild.equals(PDBDocField.PDB_ID))
       {
-        break;
+        break; // once PDB Id index is determined exit iteration
       }
-      ++pdbFeildIndex;
+      ++pdbFeildIndexCounter;
     }
-    return pdbFeildIndex;
+    return pdbFeildIndexCounter;
   }
 
   /**