@Override public boolean isLocked() { return super.isLocked(); }
public void lock() throws LockException { if (isLocked()) throw new LockException("Already locked"); this.locked = true; }
@Override public void lock() throws LockException { if (isLocked()) throw new LockException("Already locked"); this.locked = true; }
/** * @throws ModelRuntimeException * if the ModelSet is locked */ public void update(DiffReader diff) throws ModelRuntimeException { synchronized (this) { if (this.isLocked()) { throw new ModelRuntimeException( "ModelSet is locked, cannot perform an update."); } // remove Iterator<? extends Statement> it = diff.getRemoved().iterator(); while (it.hasNext()) { Statement stmt = it.next(); this.removeStatement(stmt); } // add it = diff.getAdded().iterator(); while (it.hasNext()) { Statement stmt = it.next(); this.addStatement(stmt); } } }
/** * @throws ModelRuntimeException * if the ModelSet is locked */ @Override public void update(DiffReader diff) throws ModelRuntimeException { synchronized (this) { if (this.isLocked()) { throw new ModelRuntimeException( "ModelSet is locked, cannot perform an update."); } // remove Iterator<? extends Statement> it = diff.getRemoved().iterator(); while (it.hasNext()) { Statement stmt = it.next(); this.removeStatement(stmt); } // add it = diff.getAdded().iterator(); while (it.hasNext()) { Statement stmt = it.next(); this.addStatement(stmt); } } }