1 6 7 package com.hp.hpl.jena.graph.impl; 8 9 import com.hp.hpl.jena.graph.*; 10 import com.hp.hpl.jena.graph.query.*; 11 import com.hp.hpl.jena.shared.*; 12 import com.hp.hpl.jena.util.iterator.*; 13 14 18 public class WrappedGraph implements GraphWithPerform 19 { 20 protected Graph base; 21 protected Reifier reifier; 22 protected BulkUpdateHandler bud; 23 protected GraphEventManager gem; 24 25 public WrappedGraph( Graph base ) 26 { this.base = base; 27 this.reifier = new WrappedReifier( base.getReifier(), this ); } 28 29 public boolean dependsOn( Graph other ) 30 { return base.dependsOn( other ); } 31 32 public QueryHandler queryHandler() 33 { return base.queryHandler(); } 34 35 public TransactionHandler getTransactionHandler() 36 { return base.getTransactionHandler(); } 37 38 public BulkUpdateHandler getBulkUpdateHandler() 39 { 40 if (bud == null) bud = new WrappedBulkUpdateHandler( this, base.getBulkUpdateHandler() ); 41 return bud; 42 } 43 44 public Capabilities getCapabilities() 45 { return base.getCapabilities(); } 46 47 public GraphEventManager getEventManager() 48 { 49 if (gem == null) gem = new SimpleEventManager( this ); 50 return gem; 51 } 52 53 public Reifier getReifier() 54 {return reifier; } 55 56 public PrefixMapping getPrefixMapping() 57 { return base.getPrefixMapping(); } 58 59 public void add( Triple t ) 60 { base.add( t ); 61 getEventManager().notifyAddTriple( this, t ); } 62 63 public void delete( Triple t ) 64 { base.delete( t ); 65 getEventManager().notifyDeleteTriple( this, t ); } 66 67 public ExtendedIterator find( TripleMatch m ) 68 { return SimpleEventManager.notifyingRemove( this, base.find( m ) ); } 69 70 public ExtendedIterator find( Node s, Node p, Node o ) 71 { return SimpleEventManager.notifyingRemove( this, base.find( s, p, o ) ); } 72 73 public boolean isIsomorphicWith( Graph g ) 74 { return base.isIsomorphicWith( g ); } 75 76 public boolean contains( Node s, Node p, Node o ) 77 { return base.contains( s, p, o ); } 78 79 public boolean contains( Triple t ) 80 { return base.contains( t ); } 81 82 public void close() 83 { base.close(); } 84 85 public boolean isEmpty() 86 { return base.isEmpty(); } 87 88 public int size() 89 { return base.size(); } 90 91 public void performAdd(Triple t) 92 { base.add( t ); } 93 94 public void performDelete(Triple t) 95 { base.delete( t ); } 96 } 97 98 99 | Popular Tags |