KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > graph > GraphListener


1 /*
2   (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
3   [See end of file]
4   $Id: GraphListener.java,v 1.17 2005/02/21 11:51:56 andy_seaborne Exp $
5 */

6
7 package com.hp.hpl.jena.graph;
8
9 import java.util.*;
10
11 /**
12     Interface for listening to graph-level update events. Each time the graph is
13     poked to add or remove some triples, and after that poke has completed
14     without throwing an exception, all the listeners attached to the Graph are
15     informed about the poke.
16     
17     @author Jeremy Carroll, extensions by kers
18 */

19
20 public interface GraphListener
21     {
22     /**
23         Method called when a single triple has been added to the graph.
24     */

25     void notifyAddTriple( Graph g, Triple t );
26     
27     /**
28         Method called when an array of triples has been added to the graph.
29     */

30     void notifyAddArray( Graph g, Triple [] triples );
31     
32     /**
33         Method called when a list [of triples] has been added to the graph.
34     */

35     void notifyAddList( Graph g, List triples );
36     
37     /**
38         Method called when an iterator [of triples] has been added to the graph
39     */

40     void notifyAddIterator( Graph g, Iterator it );
41     
42     /**
43         Method called when another graph <code>g</code> has been used to
44         specify the triples added to our attached graph.
45         @param g the graph of triples added
46      */

47     void notifyAddGraph( Graph g, Graph added );
48     
49     /**
50         Method called when a single triple has been deleted from the graph.
51     */

52     void notifyDeleteTriple( Graph g, Triple t );
53     
54     /**
55         Method called when a list [of triples] has been deleted from the graph.
56     */

57     void notifyDeleteList( Graph g, List L );
58     
59     /**
60         Method called when an array of triples has been deleted from the graph.
61     */

62     void notifyDeleteArray( Graph g, Triple [] triples );
63     
64     /**
65         Method called when an iterator [of triples] has been deleted from the graph.
66     */

67     void notifyDeleteIterator( Graph g, Iterator it );
68     
69     /**
70         Method to call when another graph has been used to specify the triples
71         deleted from our attached graph.
72         @param g the graph of triples added
73      */

74     void notifyDeleteGraph( Graph g, Graph removed );
75     
76     /**
77          method to call for a general event
78         @param value
79      */

80     void notifyEvent( Graph source, Object JavaDoc value );
81     }
82
83 /*
84     (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
85     All rights reserved.
86
87     Redistribution and use in source and binary forms, with or without
88     modification, are permitted provided that the following conditions
89     are met:
90
91     1. Redistributions of source code must retain the above copyright
92        notice, this list of conditions and the following disclaimer.
93
94     2. Redistributions in binary form must reproduce the above copyright
95        notice, this list of conditions and the following disclaimer in the
96        documentation and/or other materials provided with the distribution.
97
98     3. The name of the author may not be used to endorse or promote products
99        derived from this software without specific prior written permission.
100
101     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
102     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
103     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
104     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
105     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
106     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
107     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
108     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
109     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
110     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
111 */

112
Popular Tags