import java.io.IOException;
import java.util.Enumeration;
import java.util.Hashtable;
+import java.util.Map;
+import java.util.Set;
import java.util.Vector;
/**
/**
* Properties to be added to generated alignment object
*/
- protected Hashtable properties;
+ protected Hashtable<Object, Object> properties;
long start;
*/
public AlignFile()
{
- // Shouldn't we init data structures (JBPNote: not sure - initData is for initialising the structures used for reading from a datasource, and the bare constructor hasn't got any datasource)
- initData();
+ // Shouldn't we init data structures (JBPNote: not sure - initData is for
+ // initialising the structures used for reading from a datasource, and the
+ // bare constructor hasn't got any datasource)
+ initData();
}
/**
for (int i = 0; i < seqs.size(); i++)
{
- s[i] = (SequenceI) seqs.elementAt(i);
+ s[i] = seqs.elementAt(i);
}
return s;
{
if (properties != null && properties.size() > 0)
{
- Enumeration keys = properties.keys();
- Enumeration vals = properties.elements();
+ Enumeration<Object> keys = properties.keys();
+ Enumeration<Object> vals = properties.elements();
while (keys.hasMoreElements())
{
al.setProperty(keys.nextElement(), vals.nextElement());
}
if (properties == null)
{
- properties = new Hashtable();
+ properties = new Hashtable<Object, Object>();
}
properties.put(key, value);
}
*/
protected void initData()
{
- seqs = new Vector();
+ seqs = new Vector<SequenceI>();
annotations = new Vector();
}
/**
+ * Return the alignment properties (or null if none set)
+ *
+ * @return
+ */
+ protected Set<Map.Entry<Object, Object>> getAlignmentProperties()
+ {
+ return (this.properties == null ? null : this.properties.entrySet());
+ }
+ /**
* DOCUMENT ME!
*
* @param s
*/
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 });