/** Removes an instance by its type. */ public void remove(Class<? extends T> type) throws IOException { for (T t : data) { if (t.getClass() == type) { data.remove(t); onModified(); return; } } }
public void removeAll(Class<? extends T> type) throws IOException { boolean modified = false; for (T t : data) { if (t.getClass() == type) { data.remove(t); modified = true; } } if (modified) onModified(); }
public int size() { return data.size(); }
public T get(int index) { return data.get(index); }
public void replaceBy(Collection<? extends T> col) throws IOException { data.replaceBy(col); onModified(); }
public void addAll(Collection<? extends T> items) throws IOException { data.addAll(items); onModified(); }
public void add(T item) throws IOException { data.add(item); onModified(); }
protected PersistedList(Collection<? extends T> initialList) { data.replaceBy(initialList); }
public boolean isEmpty() { return data.isEmpty(); }
public void addAllTo(Collection<? super T> dst) { data.addAllTo(dst); }
/** Gets all the {@link Describable}s in an array. */ public T[] toArray(T[] array) { return data.toArray(array); }
/** Returns the snapshot view of instances as list. */ public List<T> toList() { return data.getView(); }
public Iterator<T> iterator() { return data.iterator(); }
public void clear() { data.clear(); }
public boolean remove(T o) throws IOException { boolean b = data.remove(o); if (b) onModified(); return b; }