/** 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 boolean remove(T o) throws IOException { boolean b = data.remove(o); if (b) onModified(); return b; }