Merge branch 'releases/Release_2_10_1_Branch'
[jalview.git] / src / jalview / io / StructureFile.java
index 2fe386b..97b246f 100644 (file)
@@ -45,6 +45,11 @@ public abstract class StructureFile extends AlignFile
 
   private String id;
 
+  public enum StructureFileType
+  {
+    PDB, MMCIF, MMTF
+  };
+
   private PDBEntry.Type dbRefType;
 
   /**
@@ -67,6 +72,8 @@ public abstract class StructureFile extends AlignFile
 
   private Vector<PDBChain> chains;
 
+  private boolean pdbIdAvailable;
+
   public StructureFile(String inFile, String type) throws IOException
   {
     super(inFile, type);
@@ -467,4 +474,35 @@ public abstract class StructureFile extends AlignFile
   {
     return new PDBFeatureSettings();
   }
+
+  /**
+   * Answers true if the structure file has a PDBId
+   * 
+   * @return
+   */
+  public boolean isPPDBIdAvailable()
+  {
+    return pdbIdAvailable;
+  }
+
+  public void setPDBIdAvailable(boolean pdbIdAvailable)
+  {
+    this.pdbIdAvailable = pdbIdAvailable;
+  }
+
+  public static boolean isStructureFile(String fileType)
+  {
+    if (fileType == null)
+    {
+      return false;
+    }
+    for (StructureFileType sfType : StructureFileType.values())
+    {
+      if (sfType.name().equalsIgnoreCase(fileType))
+      {
+        return true;
+      }
+    }
+    return false;
+  }
 }