/** * To find in the union, find in the components, concatenate the results, and omit duplicates. * That last is a performance penalty, but I see no way to remove it unless we know the graphs do * not overlap. */ @Override public ExtendedIterator<Triple> graphBaseFind(final TripleMatch t) { Set<Triple> seen = CollectionFactory.createHashedSet(); return recording(L.find(t), seen).andThen(rejecting(R.find(t), seen)); // return L.find( t ) .andThen( rejecting( R.find( t ), L ) ); }
/** To remove a triple, remove it from <i>both</i> operands. */ @Override public void performDelete(Triple t) { L.delete(t); R.delete(t); }
@Override public boolean graphBaseContains(Triple t) { return L.contains(t) || R.contains(t); }
/** To add a triple to the union, add it to the left operand; this is asymmetric. */ @Override public void performAdd(Triple t) { L.add(t); }