/** * Adds all of the elements in the specified collection to this set if * they're not already present (optional operation). If the specified * collection is also a set, the <tt>addAll</tt> operation effectively * modifies this set so that its value is the <i>union</i> of the two * sets. The behavior of this operation is undefined if the specified * collection is modified while the operation is in progress. * * @param c collection containing elements to be added to this set * @return <tt>true</tt> if this set changed as a result of the call * * @throws UnsupportedOperationException if the <tt>addAll</tt> operation * is not supported by this set * @throws ClassCastException if the class of an element of the * specified collection prevents it from being added to this set * @throws NullPointerException if the specified collection contains one * or more null elements and this set does not permit null * elements, or if the specified collection is null * @throws IllegalArgumentException if some property of an element of the * specified collection prevents it from being added to this set * @see #add(Object) */ @Override public synchronized boolean addAll(Collection<? extends Triple> c) { boolean modified = false; for(Triple t : c) { modified = add(t) || modified; } return modified; }
/** * Adds all of the elements in the specified collection to this set if * they're not already present (optional operation). If the specified * collection is also a set, the <tt>addAll</tt> operation effectively * modifies this set so that its value is the <i>union</i> of the two * sets. The behavior of this operation is undefined if the specified * collection is modified while the operation is in progress. * * @param c collection containing elements to be added to this set * @return <tt>true</tt> if this set changed as a result of the call * * @throws UnsupportedOperationException if the <tt>addAll</tt> operation * is not supported by this set * @throws ClassCastException if the class of an element of the * specified collection prevents it from being added to this set * @throws NullPointerException if the specified collection contains one * or more null elements and this set does not permit null * elements, or if the specified collection is null * @throws IllegalArgumentException if some property of an element of the * specified collection prevents it from being added to this set * @see #add(Object) */ @Override public synchronized boolean addAll(Collection<? extends Triple> c) { boolean modified = false; for(Triple t : c) { modified = add(t) || modified; } return modified; }
public void addTriple(Statement triple) { addedTriples.add(triple); removedTriples.remove(triple); }
public void addTriple(Statement triple) { addedTriples.add(triple); removedTriples.remove(triple); }
public void removeTriple(Statement triple) { addedTriples.remove(triple); removedTriples.add(triple); }
public void removeTriple(Statement triple) { addedTriples.remove(triple); removedTriples.add(triple); }
try { cacheTriple(triple); tripleBatch.add(triple); maybeFlushBatch(); } finally {
try { cacheTriple(triple); tripleBatch.add(triple); maybeFlushBatch(); } finally {