*/
package jalview.io;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Vector;
+
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.util.MessageManager;
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
/**
* DOCUMENT ME!
*
protected Vector<AlignmentAnnotation> annotations;
/**
+ * SequenceGroups to be added to the alignment object
+ */
+ protected List<SequenceGroup> seqGroups;
+
+ /**
* Properties to be added to generated alignment object
*/
protected Hashtable properties;
return seqs;
}
+ public List<SequenceGroup> getSeqGroups()
+ {
+ return seqGroups;
+ }
+
/**
* Return the Sequences in the seqs Vector as an array of Sequences
*/
for (int i = 0; i < seqs.size(); i++)
{
- s[i] = (SequenceI) seqs.elementAt(i);
+ s[i] = seqs.elementAt(i);
}
return s;
* Rna.GetBasePairsFromAlignmentAnnotation(annotations.elementAt(i));
* Rna.HelixMap(pairArray);
*/
- AlignmentAnnotation an = (AlignmentAnnotation) annotations
+ AlignmentAnnotation an = annotations
.elementAt(i);
an.validateRangeAndDisplay();
al.addAnnotation(an);
}
+ public void addSeqGroups(AlignmentI al)
+ {
+ this.seqGroups = al.getGroups();
+
+ }
+
/**
* Add any additional information extracted from the file to the alignment
* properties.
*/
protected void initData()
{
- seqs = new Vector();
- annotations = new Vector();
+ seqs = new Vector<SequenceI>();
+ annotations = new Vector<AlignmentAnnotation>();
+ seqGroups = new ArrayList<SequenceGroup>();
parseCalled=false;
}
*/
protected void setSeqs(SequenceI[] s)
{
- seqs = new Vector();
+ seqs = new Vector<SequenceI>();
for (int i = 0; i < s.length; i++)
{
/**
* vector of String[] treeName, newickString pairs
*/
- Vector newickStrings = null;
+ Vector<String[]> newickStrings = null;
protected void addNewickTree(String treeName, String newickString)
{
if (newickStrings == null)
{
- newickStrings = new Vector();
+ newickStrings = new Vector<String[]>();
}
newickStrings.addElement(new String[]
{ treeName, newickString });
protected int getTreeCount()
{
- if (newickStrings == null)
- {
- return 0;
- }
- return newickStrings.size();
+ return newickStrings == null ? 0 : newickStrings.size();
}
}