}
}
+ /* (non-Javadoc)
+ * @see jalview.datamodel.SequenceI#getAnnotation(java.lang.String)
+ */
+ public AlignmentAnnotation[] getAnnotation(String label)
+ {
+ if (annotation==null || annotation.size()==0)
+ {
+ return null;
+ }
+
+ Vector subset = new Vector();
+ Enumeration e = annotation.elements();
+ while (e.hasMoreElements())
+ {
+ AlignmentAnnotation ann = (AlignmentAnnotation) e.nextElement();
+ if (ann.label!=null && ann.label.equals(label))
+ {
+ subset.addElement(ann);
+ }
+ }
+ if (subset.size()==0)
+ {
+ return null;
+ }
+ AlignmentAnnotation[] anns = new AlignmentAnnotation[subset.size()];
+ int i=0;
+ e = subset.elements();
+ while (e.hasMoreElements())
+ {
+ anns[i++] = (AlignmentAnnotation) e.nextElement();
+ }
+ subset.removeAllElements();
+ return anns;
+ }
+
}
* @param revealed
*/
public void setAlignmentAnnotation(AlignmentAnnotation[] annotation);
+ /**
+ * Get one or more alignment annotations with a particular label.
+ * @param label string which each returned annotation must have as a label.
+ * @return null or array of annotations.
+ */
+ public AlignmentAnnotation[] getAnnotation(String label);
}