X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequence.java;h=42303660de8a07b5f50bd7454509edaf43460a2d;hb=bbc8fc127287ad3a11f0b470d37d741ddca162ff;hp=bb9c0f53ca9158052315ed9a6c808fa6d4c571a7;hpb=ceba202c97c435a5a0f70307961ba74316bd8312;p=jalview.git diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index bb9c0f5..4230366 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -86,7 +86,6 @@ public class Sequence extends ASequence implements SequenceI HiddenMarkovModel hmm; boolean isHMMConsensusSequence = false; - private DBModList dbrefs; // controlled access /** @@ -385,7 +384,6 @@ public class Sequence extends ASequence implements SequenceI { this.hmm = new HiddenMarkovModel(seq.getHMM(), this); } - } @Override @@ -1441,6 +1439,7 @@ public class Sequence extends ASequence implements SequenceI @Override public void addDBRef(DBRefEntry entry) { + // TODO JAL-3980 maintain as sorted list if (datasetSequence != null) { datasetSequence.addDBRef(entry); @@ -1451,6 +1450,7 @@ public class Sequence extends ASequence implements SequenceI { dbrefs = new DBModList<>(); } + // TODO JAL-3979 LOOK UP RATHER THAN SWEEP FOR EFFICIENCY for (int ib = 0, nb = dbrefs.size(); ib < nb; ib++) { @@ -1825,14 +1825,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) { String id = ann.getCalcId(); - if (id != null && id.equals(calcId) - && ann.label != null && ann.label.equals(label)) + if ((id != null && id.equals(calcId)) + && (ann.label != null && ann.label.equals(label)) + && ((ignoreDescription && description == null) + || (ann.description != null + && ann.description.equals(description)))) { result.add(ann); } @@ -1978,7 +1994,6 @@ public class Sequence extends ASequence implements SequenceI } return false; } - /** * {@inheritDoc} */