Package org.apache.jena.rdf.model.impl
Class ModelListenerAdapter
- java.lang.Object
-
- org.apache.jena.rdf.model.impl.ModelListenerAdapter
-
- All Implemented Interfaces:
GraphListener
public class ModelListenerAdapter extends java.lang.Object implements GraphListener
Adapter class that converts a ModelChangedListener into a GraphListener. The only tricky bit is that we have to implement equality as equality of the underlying ModelChangedListeners/ModelCom pairs.This implementation only works for
ModelCom
models, because it relies on various service methods; this gives the model the opportunity to cache various mappings for efficiency.
-
-
Constructor Summary
Constructors Constructor Description ModelListenerAdapter(ModelCom m, ModelChangedListener L)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
void
notifyAddArray(Graph graph, Triple[] triples)
Method called when an array of triples has been added to the graph.void
notifyAddGraph(Graph g, Graph added)
Method called when another graphg
has been used to specify the triples added to our attached graph.void
notifyAddIterator(Graph g, java.util.Iterator<Triple> it)
Method called when an iterator [of triples] has been added to the graphvoid
notifyAddIterator(Graph g, java.util.List<Triple> triples)
void
notifyAddList(Graph g, java.util.List<Triple> triples)
Method called when a list [of triples] has been added to the graph.void
notifyAddTriple(Graph g, Triple t)
Method called when a single triple has been added to the graph.void
notifyDeleteArray(Graph g, Triple[] triples)
Method called when an array of triples has been deleted from the graph.void
notifyDeleteGraph(Graph g, Graph removed)
Method to call when another graph has been used to specify the triples deleted from our attached graph.void
notifyDeleteIterator(Graph g, java.util.Iterator<Triple> it)
Method called when an iterator [of triples] has been deleted from the graph.void
notifyDeleteList(Graph g, java.util.List<Triple> triples)
Method called when a list [of triples] has been deleted from the graph.void
notifyDeleteTriple(Graph g, Triple t)
Method called when a single triple has been deleted from the graph.void
notifyEvent(Graph g, java.lang.Object event)
method to call for a general event.boolean
sameAs(ModelListenerAdapter other)
-
-
-
Constructor Detail
-
ModelListenerAdapter
public ModelListenerAdapter(ModelCom m, ModelChangedListener L)
-
-
Method Detail
-
notifyAddArray
public void notifyAddArray(Graph graph, Triple[] triples)
Description copied from interface:GraphListener
Method called when an array of triples has been added to the graph.- Specified by:
notifyAddArray
in interfaceGraphListener
-
notifyDeleteArray
public void notifyDeleteArray(Graph g, Triple[] triples)
Description copied from interface:GraphListener
Method called when an array of triples has been deleted from the graph.- Specified by:
notifyDeleteArray
in interfaceGraphListener
-
notifyAddTriple
public void notifyAddTriple(Graph g, Triple t)
Description copied from interface:GraphListener
Method called when a single triple has been added to the graph.- Specified by:
notifyAddTriple
in interfaceGraphListener
-
notifyAddList
public void notifyAddList(Graph g, java.util.List<Triple> triples)
Description copied from interface:GraphListener
Method called when a list [of triples] has been added to the graph.- Specified by:
notifyAddList
in interfaceGraphListener
-
notifyAddIterator
public void notifyAddIterator(Graph g, java.util.Iterator<Triple> it)
Description copied from interface:GraphListener
Method called when an iterator [of triples] has been added to the graph- Specified by:
notifyAddIterator
in interfaceGraphListener
-
notifyAddGraph
public void notifyAddGraph(Graph g, Graph added)
Description copied from interface:GraphListener
Method called when another graphg
has been used to specify the triples added to our attached graph.- Specified by:
notifyAddGraph
in interfaceGraphListener
- Parameters:
g
- the graph of triples added
-
notifyDeleteIterator
public void notifyDeleteIterator(Graph g, java.util.Iterator<Triple> it)
Description copied from interface:GraphListener
Method called when an iterator [of triples] has been deleted from the graph.- Specified by:
notifyDeleteIterator
in interfaceGraphListener
-
notifyDeleteTriple
public void notifyDeleteTriple(Graph g, Triple t)
Description copied from interface:GraphListener
Method called when a single triple has been deleted from the graph.- Specified by:
notifyDeleteTriple
in interfaceGraphListener
-
notifyDeleteList
public void notifyDeleteList(Graph g, java.util.List<Triple> triples)
Description copied from interface:GraphListener
Method called when a list [of triples] has been deleted from the graph.- Specified by:
notifyDeleteList
in interfaceGraphListener
-
notifyDeleteGraph
public void notifyDeleteGraph(Graph g, Graph removed)
Description copied from interface:GraphListener
Method to call when another graph has been used to specify the triples deleted from our attached graph.- Specified by:
notifyDeleteGraph
in interfaceGraphListener
- Parameters:
g
- the graph of triples added
-
notifyEvent
public void notifyEvent(Graph g, java.lang.Object event)
Description copied from interface:GraphListener
method to call for a general event.value
is usually aGraphEvents
. Special attention is drawn toGraphEvents.removeAll
and events whoseGraphEvents.getTitle()
is"remove"
(seeGraphEvents.remove(Node, Node, Node)
. Unlike other notifications, the listener cannot tell which triples have been modified, since they have already been deleted by the time this event is sent, and the event does not include a record of them.- Specified by:
notifyEvent
in interfaceGraphListener
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
sameAs
public boolean sameAs(ModelListenerAdapter other)
-
-