/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1)
* Copyright (C) 2014 The Jalview Authors
*
* This file is part of Jalview.
endRes = seqsel.endRes;
cs = seqsel.cs;
if (seqsel.description != null)
+ {
description = new String(seqsel.description);
+ }
hidecols = seqsel.hidecols;
hidereps = seqsel.hidereps;
idColour = seqsel.idColour;
}
}
if (!found)
+ {
continue;
+ }
}
AlignmentAnnotation newannot = new AlignmentAnnotation(
seq.getAnnotation()[a]);
}
/**
+ * 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))
+ {
+ aa.add(ann);
+ }
+ }
+ return aa;
+ }
+
+ /**
* Answer true if any annotation matches the calcId passed in (if not null).
*
* @param calcId
{
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;
- }
}