/** * Removes a blip from this wavelet. * * @param blipId the id of the blip to be removed. */ public void delete(String blipId) { operationQueue.deleteBlip(this, blipId); Blip removed = blips.remove(blipId); if (removed != null) { // Remove the blip from the parent blip. Blip parentBlip = removed.getParentBlip(); if (parentBlip != null) { parentBlip.deleteChildBlipId(blipId); } // Remove the blip from the containing thread. BlipThread thread = removed.getThread(); if (thread != null) { thread.removeBlip(removed); } // If the containing thread is now empty, remove it from the parent blip // and from the wavelet. if (thread != null && parentBlip != null && thread.isEmpty()) { parentBlip.removeThread(thread); threads.remove(thread.getId()); } } }