1 6 7 package com.hp.hpl.jena.rdf.model.impl; 8 9 import com.hp.hpl.jena.graph.*; 10 import com.hp.hpl.jena.rdf.model.*; 11 12 import java.util.*; 13 14 25 public class ModelListenerAdapter implements GraphListener 26 { 27 protected ModelCom m; 28 protected ModelChangedListener L; 29 30 public ModelListenerAdapter( ModelCom m, ModelChangedListener L ) 31 { this.m = m; this.L = L; } 32 33 public void notifyAddArray( Graph graph, Triple [] triples ) 34 { L.addedStatements( m.asStatements( triples ) ); } 35 36 public void notifyDeleteArray( Graph g, Triple [] triples ) 37 { L.removedStatements( m.asStatements( triples ) ); } 38 39 public void notifyAddTriple( Graph g, Triple t ) 40 { L.addedStatement( m.asStatement( t ) ); } 41 42 public void notifyAddList( Graph g, List triples ) 43 { L.addedStatements( m.asStatements( triples ) ); } 44 45 public void notifyAddIterator( Graph g, Iterator it ) 46 { L.addedStatements( m.asStatements( it ) ); } 47 48 public void notifyAddGraph( Graph g, Graph added ) 49 { L.addedStatements( m.asModel( added ) ); } 50 51 public void notifyDeleteIterator( Graph g, Iterator it ) 52 { L.removedStatements( m.asStatements( it ) ); } 53 54 public void notifyDeleteTriple( Graph g, Triple t ) 55 { L.removedStatement( m.asStatement( t ) ); } 56 57 public void notifyAddIterator( Graph g, List triples ) 58 { L.addedStatements( m.asStatements( triples ) ); } 59 60 public void notifyDeleteList( Graph g, List triples ) 61 { L.removedStatements( m.asStatements( triples ) ); } 62 63 public void notifyDeleteGraph( Graph g, Graph removed ) 64 { L.removedStatements( m.asModel( removed ) ); } 65 66 public void notifyEvent( Graph g, Object event ) 67 { L.notifyEvent( m, event ); } 68 69 public boolean equals( Object other ) 70 { 71 return 72 other instanceof ModelListenerAdapter 73 && ((ModelListenerAdapter) other).sameAs( this ) 74 ; 75 } 76 77 public boolean sameAs( ModelListenerAdapter other ) 78 { return this.L.equals( other.L ) && this.m.equals( other.m ); } 79 } 80 81 110 | Popular Tags |