319df9f2ffa3da9ea1e0f8586cb65d3845925778
[jalview.git] / src / jalview / io / FileFormatI.java
1 package jalview.io;
2
3 import jalview.datamodel.AlignmentI;
4
5 import java.io.IOException;
6
7 public interface FileFormatI
8 {
9
10   AlignmentFileI getAlignmentFile(String inFile, DataSourceType sourceType)
11           throws IOException;
12
13   // TODO can we get rid of one of these methods?
14   AlignmentFileI getAlignmentFile(FileParse source) throws IOException;
15
16   AlignmentFileI getAlignmentFile(AlignmentI al);
17
18   AlignmentFileI getAlignmentFile();
19
20   boolean isComplexAlignFile();
21
22   /**
23    * Returns a comma-separated list of file extensions associated with the
24    * format
25    * 
26    * @return
27    */
28   String getExtensions();
29
30   /**
31    * Answers true if the format is one that Jalview can read. This implies that
32    * the format provides implementations for getAlignmentFile(FileParse) and
33    * getAlignmentFile(String, DataSourceType) which parse the data source for
34    * sequence data.
35    * 
36    * @return
37    */
38   boolean isReadable();
39
40   /**
41    * Answers true if the format is one that Jalview can write. This implies that
42    * the object returned by getAlignmentFile provides an implementation of the
43    * print() method.
44    * 
45    * @return
46    */
47   boolean isWritable();
48
49   /**
50    * Answers true if the format is one that Jalview can output as text, e.g. to
51    * a text box
52    * 
53    * @return
54    */
55   boolean isTextFormat();
56 }