{
return dataset;
}
-
- /**
- * Returns an iterable collection of annotations on this alignment which match
- * the given criteria.
- */
- @Override
- public Iterable<AlignmentAnnotation> findAnnotation(SequenceI datasequence,
- String calcId, String label)
- {
- List<AlignmentAnnotation> result = new ArrayList<AlignmentAnnotation>();
- for (AlignmentAnnotation ann : annotations)
- {
- // only sequence-linked annotations can qualify (have a datasequence)
- if (ann.sequenceRef == null)
- {
- continue;
- }
- boolean matchDatasequence = (ann.sequenceRef.getDatasetSequence() == datasequence);
- final String annCalcId = ann.getCalcId();
- boolean matchCalcId = (annCalcId != null && annCalcId.equals(calcId));
- boolean matchLabel = (ann.label != null && ann.label.equals(label));
- if (matchDatasequence && matchCalcId && matchLabel)
- {
- result.add(ann);
- }
- }
- return result;
- }
}
* alignment, parent group).
*/
AnnotatedCollectionI getContext();
-
- /**
- * Return an iterable set of any annotations in the collection that match the
- * provided criteria, i.e.
- * <ul>
- * <li>reference the same sequence datasequence</li>
- * <li>have the same calcId (source of annotation)</li>
- * <li>have the same label (type of annotation)</li>
- * </ul>
- *
- * @param datasequence
- * @param calcId
- * @param label
- * @return
- */
- Iterable<AlignmentAnnotation> findAnnotation(SequenceI datasequence,
- String calcId, String label);
}
{
return context;
}
-
- @Override
- public Iterable<AlignmentAnnotation> findAnnotation(
- SequenceI datasequence, String calcId, String label)
- {
- List<AlignmentAnnotation> result = new ArrayList<AlignmentAnnotation>();
- for (AlignmentAnnotation ann : getAlignmentAnnotation())
- {
- // only sequence-linked annotations can qualify (have a datasequence)
- if (ann.sequenceRef == null)
- {
- continue;
- }
- boolean matchDatasequence = (ann.sequenceRef.getDatasetSequence() == datasequence);
- final String annCalcId = ann.getCalcId();
- boolean matchCalcId = (annCalcId != null && annCalcId.equals(calcId));
- boolean matchLabel = (ann.label != null && ann.label.equals(label));
- if (matchDatasequence && matchCalcId && matchLabel)
- {
- result.add(ann);
- }
- }
- return result;
- }
}