public OwnedCollection(Collection<E> wrapped, RefObject owner) { this.wrapped = wrapped; this.owner = owner; for (E e : wrapped) { e.markOwner(owner); } }
public boolean addAll(Collection<? extends E> c) { for (E e : c) { e.markOwner(owner); } return wrapped.addAll(c); }
public boolean add(E e) { e.markOwner(owner); return wrapped.add(e); }