@Override public void insert(DBIDRef id, O val) { assert (ids.contains(id)) : "Object not yet in DBIDs."; if(!(content instanceof WritableDataStore)) { throw new AbortException("Data is stored in a non-writable data store. Modifications are not possible."); } ((WritableDataStore<O>) content).put(id, val); for(It<Index> it = this.getHierarchy().iterDescendants(this).filter(Index.class); it.valid(); it.advance()) { if(!(it.get() instanceof DynamicIndex)) { throw new AbortException("A non-dynamic index was added to this database. Modifications are not allowed, unless this index is removed."); } ((DynamicIndex) it.get()).insert(id); } }
@Override public void insert(DBIDRef id, O val) { assert (ids.contains(id)) : "Object not yet in DBIDs."; if(!(content instanceof WritableDataStore)) { throw new AbortException("Data is stored in a non-writable data store. Modifications are not possible."); } ((WritableDataStore<O>) content).put(id, val); for(It<Index> it = this.getHierarchy().iterDescendants(this).filter(Index.class); it.valid(); it.advance()) { if(!(it.get() instanceof DynamicIndex)) { throw new AbortException("A non-dynamic index was added to this database. Modifications are not allowed, unless this index is removed."); } ((DynamicIndex) it.get()).insert(id); } }
@Override public void insert(DBIDRef id, O val) { assert(ids.contains(id)) : "Object not yet in DBIDs."; if(!(content instanceof WritableDataStore)) { throw new AbortException("Data is stored in a non-writable data store. Modifications are not possible."); } ((WritableDataStore<O>) content).put(id, val); for(Iter<Result> it = this.getHierarchy().iterDescendants(this); it.valid(); it.advance()) { if(!(it.get() instanceof DynamicIndex)) { if(it.get() instanceof Index) { throw new AbortException("A non-dynamic index was added to this database. Modifications are not allowed, unless this index is removed."); } continue; } ((DynamicIndex) it.get()).insert(id); } }
/** * Delete an objects values. * * @param id ID to delete */ @Override public void delete(DBIDRef id) { assert (!ids.contains(id)) : "Object still in DBIDs."; if(!(content instanceof WritableDataStore)) { throw new AbortException("Data is stored in a non-writable data store. Modifications are not possible."); } for(It<Index> it = this.getHierarchy().iterDescendants(this).filter(Index.class); it.valid(); it.advance()) { if(!(it.get() instanceof DynamicIndex)) { throw new AbortException("A non-dynamic index was added to this database. Modifications are not allowed, unless this index is removed."); } ((DynamicIndex) it.get()).delete(id); } ((WritableDataStore<O>) content).delete(id); }
/** * Delete an objects values. * * @param id ID to delete */ @Override public void delete(DBIDRef id) { assert(!ids.contains(id)) : "Object still in DBIDs."; if(!(content instanceof WritableDataStore)) { throw new AbortException("Data is stored in a non-writable data store. Modifications are not possible."); } for(Iter<Result> it = this.getHierarchy().iterDescendants(this); it.valid(); it.advance()) { if(!(it.get() instanceof DynamicIndex)) { if(it.get() instanceof Index) { throw new AbortException("A non-dynamic index was added to this database. Modifications are not allowed, unless this index is removed."); } continue; } ((DynamicIndex) it.get()).delete(id); } ((WritableDataStore<O>) content).delete(id); }
/** * Delete an objects values. * * @param id ID to delete */ @Override public void delete(DBIDRef id) { assert (!ids.contains(id)) : "Object still in DBIDs."; if(!(content instanceof WritableDataStore)) { throw new AbortException("Data is stored in a non-writable data store. Modifications are not possible."); } for(It<Index> it = this.getHierarchy().iterDescendants(this).filter(Index.class); it.valid(); it.advance()) { if(!(it.get() instanceof DynamicIndex)) { throw new AbortException("A non-dynamic index was added to this database. Modifications are not allowed, unless this index is removed."); } ((DynamicIndex) it.get()).delete(id); } ((WritableDataStore<O>) content).delete(id); }