X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FAnnotationFile.java;h=b3b2111540fecc0a369da12f8d9dce01630bf5d1;hb=9c00e25bfdf274009a471eba895f39e2fac4c0ac;hp=5266d08ab106d3f659f9bbf1494ca787e206779d;hpb=d15e991c6f3930ab77e3082b97a18e5ef7f3b571;p=jalview.git diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index 5266d08..b3b2111 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -68,14 +68,14 @@ public class AnnotationFile * columns or hidden row keywords. * * @param annotations - * @param groups + * @param list * @param properties * @return feature file as a string. */ public String printAnnotations(AlignmentAnnotation[] annotations, - Vector groups, Hashtable properties) + List list, Hashtable properties) { - return printAnnotations(annotations, groups, properties, null); + return printAnnotations(annotations, list, properties, null); } @@ -110,13 +110,13 @@ public class AnnotationFile * properties and views. * * @param annotations - * @param groups + * @param list * @param properties * @param views * @return annotation file */ public String printAnnotations(AlignmentAnnotation[] annotations, - Vector groups, Hashtable properties, ViewDef[] views) + List list, Hashtable properties, ViewDef[] views) { // TODO: resolve views issue : annotationFile could contain visible region, // or full data + hidden region specifications for a view. @@ -393,9 +393,9 @@ public class AnnotationFile text.append(rowprops.toString()); } - if (groups != null) + if (list != null) { - printGroups(groups); + printGroups(list); } if (properties != null) @@ -419,13 +419,11 @@ public class AnnotationFile return text.toString(); } - public void printGroups(Vector sequenceGroups) + public void printGroups(List list) { - SequenceGroup sg; SequenceI seqrep = null; - for (int i = 0; i < sequenceGroups.size(); i++) + for (SequenceGroup sg:list) { - sg = (SequenceGroup) sequenceGroups.elementAt(i); if (!sg.hasSeqrep()) { text.append("SEQUENCE_GROUP\t" + sg.getName() + "\t" @@ -889,17 +887,14 @@ public class AnnotationFile } // Finally, resolve the groupRefs Enumeration en = groupRefRows.keys(); - SequenceGroup theGroup = null; - + while (en.hasMoreElements()) { groupRef = (String) en.nextElement(); boolean matched = false; // Resolve group: TODO: add a getGroupByName method to alignments - Vector grps = al.getGroups(); - for (int g = 0, gSize = grps.size(); g < gSize; g++) + for (SequenceGroup theGroup : al.getGroups()) { - theGroup = (SequenceGroup) grps.elementAt(g); if (theGroup.getName().equals(groupRef)) { if (matched) @@ -1293,15 +1288,12 @@ public class AnnotationFile { return; } - SequenceGroup sg = null; - + String name = st.nextToken(); - - Vector groups = al.getGroups(); - for (int i = 0; i < groups.size(); i++) + SequenceGroup sg=null; + for (SequenceGroup _sg:al.getGroups()) { - sg = (SequenceGroup) groups.elementAt(i); - if (sg.getName().equals(name)) + if ((sg=_sg).getName().equals(name)) { break; }