The code duplication is a right pain. The most natural removal tactic, a meta-method that took the notification method as an argument, is not available in Java, and I can't off-hand think of a clean alternative.
This class also holds the utility method notifyingRemove, which wraps iterators so that their .remove() operation notifies the specified graph of the removal.
|
|