1 6 7 package com.hp.hpl.jena.graph.compose; 8 9 import com.hp.hpl.jena.graph.*; 10 import com.hp.hpl.jena.util.CollectionFactory; 11 import com.hp.hpl.jena.util.iterator.*; 12 13 import java.util.*; 14 15 21 22 public class Union extends Dyadic implements Graph 23 { 24 public Union( Graph L, Graph R ) 25 { super( L, R ); } 26 27 30 public void performAdd( Triple t ) 31 { L.add( t ); } 32 33 36 public void performDelete( Triple t ) 37 { 38 L.delete( t ); 39 R.delete( t ); 40 } 41 42 public boolean graphBaseContains( Triple t ) 43 { return L.contains( t ) || R.contains( t ); } 44 45 50 public ExtendedIterator graphBaseFind( final TripleMatch t ) 51 { 52 Set seen = CollectionFactory.createHashedSet(); 53 return recording( L.find( t ), seen ).andThen( rejecting( R.find( t ), seen ) ); 54 } 56 } 57 58 87 | Popular Tags |