Distinguish text-only output formats and others (.jar/.jvp)
[jalview.git] / src / jalview / io / FileFormatI.java
index c9d56ae..319df9f 100644 (file)
@@ -1,5 +1,7 @@
 package jalview.io;
 
+import jalview.datamodel.AlignmentI;
+
 import java.io.IOException;
 
 public interface FileFormatI
@@ -8,12 +10,47 @@ public interface FileFormatI
   AlignmentFileI getAlignmentFile(String inFile, DataSourceType sourceType)
           throws IOException;
 
+  // TODO can we get rid of one of these methods?
   AlignmentFileI getAlignmentFile(FileParse source) throws IOException;
 
+  AlignmentFileI getAlignmentFile(AlignmentI al);
+
   AlignmentFileI getAlignmentFile();
 
   boolean isComplexAlignFile();
 
-  String getShortDescription();
-
+  /**
+   * Returns a comma-separated list of file extensions associated with the
+   * format
+   * 
+   * @return
+   */
+  String getExtensions();
+
+  /**
+   * Answers true if the format is one that Jalview can read. This implies that
+   * the format provides implementations for getAlignmentFile(FileParse) and
+   * getAlignmentFile(String, DataSourceType) which parse the data source for
+   * sequence data.
+   * 
+   * @return
+   */
+  boolean isReadable();
+
+  /**
+   * Answers true if the format is one that Jalview can write. This implies that
+   * the object returned by getAlignmentFile provides an implementation of the
+   * print() method.
+   * 
+   * @return
+   */
+  boolean isWritable();
+
+  /**
+   * Answers true if the format is one that Jalview can output as text, e.g. to
+   * a text box
+   * 
+   * @return
+   */
+  boolean isTextFormat();
 }