JAL-2909 Wire up coordinates dialog with bam file reader
[jalview.git] / src / jalview / io / AlignFile.java
index 7333075..c931cb8 100755 (executable)
@@ -40,8 +40,8 @@ import java.util.Vector;
  * @author $author$
  * @version $Revision$
  */
-public abstract class AlignFile extends FileParse implements
-        AlignmentFileReaderI, AlignmentFileWriterI
+public abstract class AlignFile extends FileParse
+        implements AlignmentFileReaderI, AlignmentFileWriterI
 {
   int noSeqs = 0;
 
@@ -118,8 +118,7 @@ public abstract class AlignFile extends FileParse implements
    * @throws IOException
    */
   public AlignFile(boolean parseImmediately, String dataObject,
-          DataSourceType sourceType)
-          throws IOException
+          DataSourceType sourceType) throws IOException
   {
     super(dataObject, sourceType);
     initData();
@@ -175,11 +174,6 @@ public abstract class AlignFile extends FileParse implements
     }
     parseCalled = true;
     parse();
-    // sets the index of each sequence in the alignment
-    for (int i = 0, c = seqs.size(); i < c; i++)
-    {
-      seqs.get(i).setIndex(i);
-    }
   }
 
   /**
@@ -282,9 +276,8 @@ public abstract class AlignFile extends FileParse implements
   {
     if (key == null)
     {
-      throw new Error(
-              MessageManager
-                      .getString("error.implementation_error_cannot_have_null_alignment"));
+      throw new Error(MessageManager.getString(
+              "error.implementation_error_cannot_have_null_alignment"));
     }
     if (value == null)
     {
@@ -311,9 +304,9 @@ public abstract class AlignFile extends FileParse implements
    */
   protected void initData()
   {
-    seqs = new Vector<SequenceI>();
-    annotations = new Vector<AlignmentAnnotation>();
-    seqGroups = new ArrayList<SequenceGroup>();
+    seqs = new Vector<>();
+    annotations = new Vector<>();
+    seqGroups = new ArrayList<>();
     parseCalled = false;
   }
 
@@ -326,7 +319,7 @@ public abstract class AlignFile extends FileParse implements
   @Override
   public void setSeqs(SequenceI[] s)
   {
-    seqs = new Vector<SequenceI>();
+    seqs = new Vector<>();
 
     for (int i = 0; i < s.length; i++)
     {
@@ -397,7 +390,7 @@ public abstract class AlignFile extends FileParse implements
   {
     if (newickStrings == null)
     {
-      newickStrings = new Vector<String[]>();
+      newickStrings = new Vector<>();
     }
     newickStrings.addElement(new String[] { treeName, newickString });
   }
@@ -421,4 +414,13 @@ public abstract class AlignFile extends FileParse implements
   {
     seqs.add(seq);
   }
+
+  @Override
+  public Object[] preprocess()
+  {
+    // most AlignFiles will not need to return any preprocessing information
+    // those that do should override this method
+    return null;
+  }
+
 }