import jalview.analysis.AlignSeq;
+import java.util.ArrayList;
import java.util.Enumeration;
+import java.util.List;
import java.util.Vector;
import fr.orsay.lri.varna.models.rna.RNA;
AlignmentAnnotation[] ret = new AlignmentAnnotation[annotation.size()];
for (int r = 0; r < ret.length; r++)
{
- ret[r] = (AlignmentAnnotation) annotation.elementAt(r);
+ ret[r] = annotation.elementAt(r);
}
return ret;
return anns;
}
+ /**
+ * Returns a list of any annotations on the sequence that match the given
+ * calcId (source) and label (type). Null values do not match.
+ *
+ * @param calcId
+ * @param label
+ * @return
+ */
+ @Override
+ public List<AlignmentAnnotation> getAlignmentAnnotations(String calcId,
+ String label)
+ {
+ List<AlignmentAnnotation> result = new ArrayList<AlignmentAnnotation>();
+ if (annotation != null)
+ {
+ for (AlignmentAnnotation ann : annotation)
+ {
+ if (ann.calcId != null && ann.calcId.equals(calcId)
+ && ann.label != null && ann.label.equals(label))
+ {
+ result.add(ann);
+ }
+ }
+ }
+ return result;
+ }
+
public boolean updatePDBIds()
{
if (datasetSequence != null)
*/\r
package jalview.datamodel;\r
\r
+import java.util.List;\r
import java.util.Vector;\r
\r
import fr.orsay.lri.varna.models.rna.RNA;\r
public AlignmentAnnotation[] getAnnotation(String label);\r
\r
/**\r
+ * Return a list of any annotations which match the given calcId (source) and\r
+ * label (type). Null values do not match.\r
+ * \r
+ * @param calcId\r
+ * @param label\r
+ * @return\r
+ */\r
+ public List<AlignmentAnnotation> getAlignmentAnnotations(String calcId,\r
+ String label);\r
+\r
+ /**\r
* create a new dataset sequence (if necessary) for this sequence and sets\r
* this sequence to refer to it. This call will move any features or\r
* references on the sequence onto the dataset. It will also make a duplicate\r