1 6 package com.hp.hpl.jena.graph.impl; 7 8 import java.util.*; 9 10 import com.hp.hpl.jena.graph.*; 11 import com.hp.hpl.jena.util.IteratorCollection; 12 13 21 public class WrappedBulkUpdateHandler 22 implements BulkUpdateHandler 23 { 24 protected BulkUpdateHandler base; 25 protected GraphEventManager manager; 26 protected GraphWithPerform graph; 27 28 public WrappedBulkUpdateHandler( GraphWithPerform graph, BulkUpdateHandler base ) 29 { 30 this.graph = graph; 31 this.base = base; 32 this.manager = graph.getEventManager(); 33 } 34 35 public void add( Triple [] triples ) 36 { 37 base.add( triples ); 38 manager.notifyAddArray( graph, triples ); 39 } 40 41 public void add( List triples ) 42 { 43 base.add( triples ); 44 manager.notifyAddList( graph, triples ); 45 } 46 47 public void add( Iterator it ) 48 { 49 List s = IteratorCollection.iteratorToList( it ); 50 base.add( s ); 51 manager.notifyAddIterator( graph, s ); 52 } 53 54 public void add( Graph g, boolean withReifications ) 55 { 56 base.add( g, withReifications ); 57 manager.notifyAddGraph( graph, g ); 58 } 59 60 public void add( Graph g ) 61 { 62 base.add( g ); 63 manager.notifyAddGraph( graph, g ); 64 } 65 66 public void delete( Triple[] triples ) 67 { 68 base.delete( triples ); 69 manager.notifyDeleteArray( graph, triples ); 70 } 71 72 public void delete( List triples ) 73 { 74 base.delete( triples ); 75 manager.notifyDeleteList( graph, triples ); 76 } 77 78 public void delete( Iterator it ) 79 { 80 List s = IteratorCollection.iteratorToList( it ); 81 base.delete( s ); 82 manager.notifyDeleteIterator( graph, s ); 83 } 84 85 public void delete( Graph g ) 86 { 87 base.delete( g ); 88 manager.notifyDeleteGraph( graph, g ); 89 } 90 91 public void delete( Graph g, boolean withReifications ) 92 { 93 base.delete( g, withReifications ); 94 manager.notifyDeleteGraph( graph, g ); 95 } 96 97 public void removeAll() 98 { 99 base.removeAll(); 100 manager.notifyEvent( graph, GraphEvents.removeAll ); 101 } 102 103 public void remove( Node s, Node p, Node o ) 104 { 105 base.remove( s, p, o ); 106 manager.notifyEvent( graph, GraphEvents.remove( s, p, o ) ); 107 } 108 109 } 110 111 112 | Popular Tags |