+ * Decrement the reference counter for the given mapping, and remove it
+ * entirely if its reference counter reduces to zero.
+ *
+ * @param acf
+ */
+ public void removeMapping(AlignedCodonFrame acf)
+ {
+ if (acf != null && seqmappings.contains(acf))
+ {
+ int count = seqMappingRefCounts.get(acf);
+ count--;
+ if (count > 0)
+ {
+ seqMappingRefCounts.put(acf, count);
+ }
+ else
+ {
+ seqmappings.remove(acf);
+ seqMappingRefCounts.remove(acf);
+ }
+ }
+ }
+
+ /**
+ * Add each of the given codonFrames to the stored set. If not aready present,
+ * increments its reference count instead.