Class 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.

    • 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 interface GraphListener
      • 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 interface GraphListener
      • 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 interface GraphListener
      • notifyAddGraph

        public void notifyAddGraph​(Graph g,
                                   Graph added)
        Description copied from interface: GraphListener
        Method called when another graph g has been used to specify the triples added to our attached graph.
        Specified by:
        notifyAddGraph in interface GraphListener
        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 interface GraphListener
      • notifyAddIterator

        public void notifyAddIterator​(Graph g,
                                      java.util.List<Triple> triples)
      • 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 interface GraphListener
      • 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 interface GraphListener
        Parameters:
        g - the graph of triples added
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object