KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > rdf > model > ModelChangedListener


1 /*
2   (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
3   [See end of file]
4   $Id: ModelChangedListener.java,v 1.12 2005/02/21 12:14:06 andy_seaborne Exp $
5 */

6
7 package com.hp.hpl.jena.rdf.model;
8
9 import java.util.*;
10
11 /**
12     The interface for classes that listen for model-changed events. In all cases,
13     the argument is [a copy of] the item that has been presented to the model,
14     or its underlying graph, for addition or removal. For an add, the item [or parts
15     of that item] may have already been present in the model; for remove, the
16     item [or parts of it] need not have been absent from the item.
17 <p>
18     NOTE that the listener is supplied with more-or-less faithful copies of the
19     original items that were added to, or removed from, the model. In particular,
20     graph-level updates to the model appear as statements, not triples.
21     
22     @author kers (design by andy & the team)
23 */

24 public interface ModelChangedListener
25     {
26     /**
27         Method to call when a single statement has been added to the attached model.
28         @param s the statement that has been presented for addition.
29     */

30     void addedStatement( Statement s );
31     
32     /**
33         Method to call when an array of statements has been added to the attached
34         model. NOTE. This array need not be == to the array added using
35         Model::add(Statement[]).
36         @param statements the array of added statements
37     */

38     void addedStatements( Statement [] statements );
39     
40     /**
41         Method to call when a list of statements has been added to the attached model.
42         NOTE. This list need not be == to the list added using Model::add(List).
43         @param statements the list of statements that has been removed.
44     */

45     void addedStatements( List statements );
46     
47     /**
48         Method to call when a statement iterator has supplied elements to be added
49         to the attached model. <code>statements</code> is a copy of the
50         original iterator.
51         @param statements
52      */

53     void addedStatements( StmtIterator statements );
54     
55     /**
56         Method to call when a model has been used to define the statements to
57         be added to our attached model.
58         @param m a model equivalent to [and sharing with] the added model
59      */

60     void addedStatements( Model m );
61     
62     /**
63         Method to call when a single statement has been removed from the attached model.
64         @param s the statement that has been presented for removal.
65     */

66     void removedStatement( Statement s );
67     
68     /**
69         Method to call when an array of statements has been removed from the
70         attached model. NOTE. This array need not be == to the array added using
71         Model::remove(Statement[]).
72         @param statements the array of removed statements
73     */

74     void removedStatements( Statement [] statements );
75     
76     /**
77         Method to call when a list of statements has been deleted from the attached
78         model. NOTE. This list need not be == to the list added using
79         Model::remov(List).
80         @param statements the list of statements that have been removed.
81     */

82     void removedStatements( List statements );
83     
84     /**
85         Method to call when a statement iterator has been used to remove
86         statements from the attached model. The iterator will be a copy, in the
87         correct order, of the iterator supplied for the removal.
88         @param statements a statement-type copy of the updating iterator
89      */

90     void removedStatements( StmtIterator statements );
91     
92     /**
93         Method to call when a model has been used to remove statements from
94         our attached model.
95         @param m a model equivalent to [and sharing with] the one removed
96      */

97     
98     void removedStatements( Model m );
99     
100     void notifyEvent( Model m, Object JavaDoc event );
101     }
102
103
104 /*
105     (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
106     All rights reserved.
107
108     Redistribution and use in source and binary forms, with or without
109     modification, are permitted provided that the following conditions
110     are met:
111
112     1. Redistributions of source code must retain the above copyright
113        notice, this list of conditions and the following disclaimer.
114
115     2. Redistributions in binary form must reproduce the above copyright
116        notice, this list of conditions and the following disclaimer in the
117        documentation and/or other materials provided with the distribution.
118
119     3. The name of the author may not be used to endorse or promote products
120        derived from this software without specific prior written permission.
121
122     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
123     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
124     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
125     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
126     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
127     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
128     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
129     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
130     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
131     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
132 */
Popular Tags