protected Object writeReplace() throws ObjectStreamException { return asList(); }
public boolean containsAll(Collection all) { for (Iterator itr = all.iterator(); itr.hasNext();) if (!contains(itr.next())) return false; return true; }
public void startTracking() { _ct.startTracking(); reset(); }
public boolean retainAll(Collection all) { if (all.isEmpty()) { clear(); return true; } Proxies.dirty(this, false); Itr itr = (Itr) iterator(); try { boolean removed = false; Object rem; while (itr.hasNext()) { rem = itr.next(); if (!all.contains(rem)) { Proxies.removed(this, rem, false); _ct.removed(rem); removed = true; } } return removed; } finally { itr.close(); } }
private List asList() { Itr itr = (Itr) iterator(); try { List list = new ArrayList(); while (itr.hasNext()) list.add(itr.next()); return list; } finally { itr.close(); } }
public boolean contains(Object o) { if (_elementType != null && !_elementType.isInstance(o)) return false; if (_ct.getAdded().contains(o)) return true; if (_ct.getRemoved().contains(o)) return false; if (!has(o)) return false; return true; }
public Iterator iterator() { _iterated = true; IteratorChain chain = new IteratorChain(); chain.addIterator(new FilterIterator(itr(), this)); // note have to copy _ct.getAdded to prevent concurrent mod errors chain.addIterator(new ArrayList(_ct.getAdded()).iterator()); return new Itr(chain); }
public int size() { if (_count == -1) _count = count(); if (_count == Integer.MAX_VALUE) return _count; return _count + _ct.getAdded().size() - _ct.getRemoved().size(); }
public boolean removeAll(Collection all) { Proxies.dirty(this, false); boolean removed = false; Object rem; for (Iterator itr = all.iterator(); itr.hasNext();) { rem = itr.next(); if (remove(rem)) { Proxies.removed(this, rem, false); _ct.removed(rem); removed = true; } } return removed; }
public boolean isEmpty() { return size() == 0; }
public boolean retainAll(Collection all) { if (all.isEmpty()) { clear(); return true; } Proxies.dirty(this, false); Itr itr = (Itr) iterator(); try { boolean removed = false; Object rem; while (itr.hasNext()) { rem = itr.next(); if (!all.contains(rem)) { Proxies.removed(this, rem, false); _ct.removed(rem); removed = true; } } return removed; } finally { itr.close(); } }
private List asList() { Itr itr = (Itr) iterator(); try { List list = new ArrayList(); while (itr.hasNext()) list.add(itr.next()); return list; } finally { itr.close(); } }
public boolean contains(Object o) { if (_elementType != null && !_elementType.isInstance(o)) return false; if (_ct.getAdded().contains(o)) return true; if (_ct.getRemoved().contains(o)) return false; if (!has(o)) return false; return true; }
public Iterator iterator() { _iterated = true; IteratorChain chain = new IteratorChain(); chain.addIterator(new FilterIterator(itr(), this)); // note have to copy _ct.getAdded to prevent concurrent mod errors chain.addIterator(new ArrayList(_ct.getAdded()).iterator()); return new Itr(chain); }
public int size() { if (_count == -1) _count = count(); if (_count == Integer.MAX_VALUE) return _count; return _count + _ct.getAdded().size() - _ct.getRemoved().size(); }
public boolean removeAll(Collection all) { Proxies.dirty(this, false); boolean removed = false; Object rem; for (Iterator itr = all.iterator(); itr.hasNext();) { rem = itr.next(); if (remove(rem)) { Proxies.removed(this, rem, false); _ct.removed(rem); removed = true; } } return removed; }
public boolean isEmpty() { return size() == 0; }
public boolean retainAll(Collection all) { if (all.isEmpty()) { clear(); return true; } Proxies.dirty(this, false); Itr itr = (Itr) iterator(); try { boolean removed = false; Object rem; while (itr.hasNext()) { rem = itr.next(); if (!all.contains(rem)) { Proxies.removed(this, rem, false); _ct.removed(rem); removed = true; } } return removed; } finally { itr.close(); } }
protected Object writeReplace() throws ObjectStreamException { return asList(); }
public boolean containsAll(Collection all) { for (Iterator itr = all.iterator(); itr.hasNext();) if (!contains(itr.next())) return false; return true; }