JAL-3383 minor code tidying and commenting
[jalview.git] / src / jalview / datamodel / PDBEntry.java
index 8debacf..80e2de8 100755 (executable)
@@ -73,6 +73,7 @@ public class PDBEntry
     {
       return format;
     }
+
     public String getExtension()
     {
       return ext;
@@ -130,18 +131,11 @@ public class PDBEntry
      * CaseInsensitiveString, so we are in effect doing a 
      * case-insensitive comparison of chain codes
      */
-    boolean idMatches = id == o.id
-            || (id != null && id.equalsIgnoreCase(o.id));
-    boolean fileMatches = file == o.file
-            || (file != null && file.equals(o.file));
-    boolean typeMatches = type == o.type
-            || (type != null && type.equals(o.type));
-    if (idMatches && fileMatches && typeMatches)
-    {
-      return properties == o.properties
-              || (properties != null && properties.equals(o.properties));
-    }
-    return false;
+    return (id == o.id || (id != null && id.equalsIgnoreCase(o.id)))
+            && (file == o.file || (file != null && file.equals(o.file)))
+            && (type == o.type || (type != null && type.equals(o.type)))
+            && (properties == o.properties || (properties != null
+                    && properties.equals(o.properties)));
   }
 
   /**
@@ -151,7 +145,6 @@ public class PDBEntry
   {
   }
 
-
   public PDBEntry(String pdbId, String chain, PDBEntry.Type type,
           String filePath)
   {
@@ -164,11 +157,12 @@ public class PDBEntry
    * @param entryType
    * @param filePath
    */
-  void init(String pdbId, String chain, PDBEntry.Type entryType, String filePath)
+  void init(String pdbId, String chain, PDBEntry.Type entryType,
+          String filePath)
   {
     this.id = pdbId;
     this.type = entryType == null ? null : entryType.toString();
-    this.file = filePath;
+    this.file = (filePath == null ? null : filePath.replace('\\', '/'));
     setChainCode(chain);
   }
 
@@ -199,8 +193,8 @@ public class PDBEntry
   {
     if (!DBRefSource.PDB.equals(dbr.getSource()))
     {
-      throw new IllegalArgumentException("Invalid source: "
-              + dbr.getSource());
+      throw new IllegalArgumentException(
+              "Invalid source: " + dbr.getSource());
     }
 
     String pdbId = dbr.getAccessionId();
@@ -219,7 +213,7 @@ public class PDBEntry
 
   public void setFile(String f)
   {
-    this.file = f;
+    this.file = f.replace('\\', '/');
   }
 
   public String getFile()
@@ -256,7 +250,7 @@ public class PDBEntry
   {
     if (this.properties == null)
     {
-      this.properties = new Hashtable<String, Object>();
+      this.properties = new Hashtable<>();
     }
     properties.put(key, value);
   }