*/
public boolean deleteAnnotation(AlignmentAnnotation aa)
{
+ return deleteAnnotation(aa, true);
+ }
+
+ public boolean deleteAnnotation(AlignmentAnnotation aa, boolean unhook)
+ {
int aSize = 1;
if (annotations != null)
if (swap)
{
annotations = temp;
- unhookAnnotation(aa);
+ if (unhook) {
+ unhookAnnotation(aa);
+ }
}
return swap;
}
/**
* Deletes a specific AlignmentAnnotation from the alignment, and removes its
- * reference from any SequenceI object's annotation if and only if aa is
+ * reference from any SequenceI or SequenceGroup object's annotation if and only if aa is
* contained within the alignment's annotation vector. Otherwise, it will do
* nothing.
*
public boolean deleteAnnotation(AlignmentAnnotation aa);
/**
+ * Deletes a specific AlignmentAnnotation from the alignment, and optionally removes any
+ * reference from any SequenceI or SequenceGroup object's annotation if and only if aa is
+ * contained within the alignment's annotation vector. Otherwise, it will do
+ * nothing.
+ *
+ * @param aa
+ * the annotation to delete
+ * @param unhook
+ * flag indicating if any references should be removed from annotation - use this if you intend to add the annotation back into the alignment
+ * @return true if annotation was deleted from this alignment.
+ */
+ public boolean deleteAnnotation(AlignmentAnnotation aa, boolean unhook);
+
+ /**
* Get the annotation associated with this alignment (this can be null if no
* annotation has ever been created on the alignment)
*