X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequence.java;fp=src%2Fjalview%2Fdatamodel%2FSequence.java;h=d52e0497aa7f52b5a3c7092328c53c134cc93aa5;hb=3efc24bc7b7855ff135fa96e35ab1004eaeb4f5e;hp=552349f648f6d3057f0dd56c6eddfcb0b3ee4c3e;hpb=dae56c38c3f14e96308540c30f35ca8f1d917edf;p=jalview.git diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 552349f..d52e049 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -1799,13 +1799,30 @@ public class Sequence extends ASequence implements SequenceI public List getAlignmentAnnotations(String calcId, String label) { + return getAlignmentAnnotations(calcId, label, null, true); + } + + @Override + public List getAlignmentAnnotations(String calcId, + String label, String description) + { + return getAlignmentAnnotations(calcId, label, description, false); + } + + private List getAlignmentAnnotations(String calcId, + String label, String description, boolean ignoreDescription) + { List result = new ArrayList<>(); if (this.annotation != null) { for (AlignmentAnnotation ann : annotation) { - if (ann.calcId != null && ann.calcId.equals(calcId) - && ann.label != null && ann.label.equals(label)) + if ((ann.calcId != null && ann.calcId.equals(calcId)) + && (ann.label != null && ann.label.equals(label)) + && ((ignoreDescription && description == null) + || (ann.description != null + && ann.description.equals(description)))) + { result.add(ann); }