return aa;
}
- /**
- * Returns a list of annotations that match the specified sequenceRef, calcId
- * and label, ignoring null values.
- *
- * @return list of AlignmentAnnotation objects
- */
@Override
public Iterable<AlignmentAnnotation> findAnnotations(SequenceI seq,
String calcId, String label)
ArrayList<AlignmentAnnotation> aa = new ArrayList<AlignmentAnnotation>();
for (AlignmentAnnotation ann : getAlignmentAnnotation())
{
- if (ann.getCalcId() != null && ann.getCalcId().equals(calcId)
- && ann.sequenceRef != null && ann.sequenceRef == seq
- && ann.label != null && ann.label.equals(label))
+ if ((calcId == null || (ann.getCalcId() != null && ann.getCalcId()
+ .equals(calcId)))
+ && (seq == null || (ann.sequenceRef != null && ann.sequenceRef == seq))
+ && (label == null || (ann.label != null && ann.label
+ .equals(label))))
{
aa.add(ann);
}