JAL-3210 Improvements to eclipse detection. New src tree and SwingJS updated from...
[jalview.git] / src / jalview / ws / sifts / SiftsClient.java
index d065666..bf4d970 100644 (file)
@@ -82,6 +82,22 @@ public class SiftsClient implements SiftsClientI
    */
   private static File mockSiftsFile;
 
+  private static final int BUFFER_SIZE = 4096;
+
+  public static final int UNASSIGNED = Integer.MIN_VALUE;
+
+  private static final int PDB_RES_POS = 0;
+
+  private static final int PDB_ATOM_POS = 1;
+
+  private static final int PDBE_POS = 2;
+
+  private static final String NOT_OBSERVED = "Not_Observed";
+
+  protected static final String SIFTS_FTP_BASE_URL = "http://ftp.ebi.ac.uk/pub/databases/msd/sifts/xml/";
+
+  protected final static String NEWLINE = System.lineSeparator();
+
   private Entry siftsEntry;
 
   private StructureFile pdb;
@@ -100,22 +116,6 @@ public class SiftsClient implements SiftsClientI
    */
   private jalview.datamodel.Mapping seqFromPdbMapping;
 
-  private static final int BUFFER_SIZE = 4096;
-
-  public static final int UNASSIGNED = Integer.MIN_VALUE;
-
-  private static final int PDB_RES_POS = 0;
-
-  private static final int PDB_ATOM_POS = 1;
-
-  private static final int PDBE_POS = 2;
-
-  private static final String NOT_OBSERVED = "Not_Observed";
-
-  private static final String SIFTS_FTP_BASE_URL = "http://ftp.ebi.ac.uk/pub/databases/msd/sifts/xml/";
-
-  private final static String NEWLINE = System.lineSeparator();
-
   private String curSourceDBRef;
 
   private HashSet<String> curDBRefAccessionIdsString;
@@ -400,7 +400,7 @@ public class SiftsClient implements SiftsClientI
   @Override
   public HashSet<String> getAllMappingAccession()
   {
-    HashSet<String> accessions = new HashSet<String>();
+    HashSet<String> accessions = new HashSet<>();
     List<Entity> entities = siftsEntry.getEntity();
     for (Entity entity : entities)
     {
@@ -467,7 +467,7 @@ public class SiftsClient implements SiftsClientI
     entity = getEntityById(entityId);
     String originalSeq = AlignSeq.extractGaps(
             jalview.util.Comparison.GapChars, seq.getSequenceAsString());
-    HashMap<Integer, int[]> mapping = new HashMap<Integer, int[]>();
+    HashMap<Integer, int[]> mapping = new HashMap<>();
     DBRefEntryI sourceDBRef;
     sourceDBRef = getValidSourceDBRef(seq);
     // TODO ensure sequence start/end is in the same coordinate system and
@@ -479,7 +479,7 @@ public class SiftsClient implements SiftsClientI
       seqCoordSys = CoordinateSys.PDB;
     }
 
-    HashSet<String> dbRefAccessionIdsString = new HashSet<String>();
+    HashSet<String> dbRefAccessionIdsString = new HashSet<>();
     for (DBRefEntry dbref : seq.getDBRefs())
     {
       dbRefAccessionIdsString.add(dbref.getAccessionId().toLowerCase());
@@ -489,7 +489,7 @@ public class SiftsClient implements SiftsClientI
     curDBRefAccessionIdsString = dbRefAccessionIdsString;
     curSourceDBRef = sourceDBRef.getAccessionId();
 
-    TreeMap<Integer, String> resNumMap = new TreeMap<Integer, String>();
+    TreeMap<Integer, String> resNumMap = new TreeMap<>();
     List<Segment> segments = entity.getSegment();
     SegmentHelperPojo shp = new SegmentHelperPojo(seq, mapping, resNumMap,
             omitNonObserved, nonObservedShiftIndex,pdbeNonObserved);
@@ -668,9 +668,9 @@ public class SiftsClient implements SiftsClientI
         }
         if (!isObserved)
         {
-          ++pdbeNonObservedCount;
+          ++pdbeNonObservedCount; // TODO this value is never used
         }
-        if (seqCoordSys == seqCoordSys.PDB) // FIXME: is seqCoordSys ever PDBe
+        if (seqCoordSys == CoordinateSys.PDB) // FIXME: is seqCoordSys ever PDBe
                                             // ???
         {
           // if the sequence has a primary reference to the PDB, then we are
@@ -850,7 +850,7 @@ public class SiftsClient implements SiftsClientI
   private Set<String> getResidueAnnotaitons(Residue residue,
           ResidueDetailType type)
   {
-    HashSet<String> foundAnnotations = new HashSet<String>();
+    HashSet<String> foundAnnotations = new HashSet<>();
     List<ResidueDetail> resDetails = residue.getResidueDetail();
     for (ResidueDetail resDetail : resDetails)
     {
@@ -995,6 +995,10 @@ public class SiftsClient implements SiftsClientI
 
     public int resCount;
 
+    protected SiftsEntitySortPojo()
+    {
+    }
+
     @Override
     public int compareTo(SiftsEntitySortPojo o)
     {
@@ -1044,6 +1048,7 @@ public class SiftsClient implements SiftsClientI
     {
       return pdbeNonObserved;
     }
+
     public SequenceI getSeq()
     {
       return seq;