KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2   (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
3   [See end of file]
4   $Id: BulkUpdateHandler.java,v 1.11 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     Defines how bulk update may be done on Graphs.
13 <p>
14     Bulk updates are not necessarily transactions; that is, a bulk update may
15     fail part-way through, leaving some but not all triples added or deleted.
16     However, if a bulk update does not fail (ie throw an exception) then the
17     addition or removal of triples must have been successfully completed
18     in accordance with the operation of the owning graph.
19     
20     @author kers
21 */

22 public interface BulkUpdateHandler
23     {
24     /**
25         Add all the triples into the graph this is handler for.
26         @param triples an array of triples to add
27     */

28     void add( Triple [] triples );
29     
30     /**
31         Add all the triples in the list into the graph this is handler for.
32         Each element of the List must be a Triple.
33         @param triples a list of Triple objects to add
34     */

35     void add( List triples );
36     
37     /**
38         Add all the elements from the iterator into the graph this is handler for.
39         Each element of the iterator must be a Triple. WARNING. An implementation may
40         have to expand the iterator into a data structure containing all the component
41         elements; hence long iterators may be expensive on store.
42         @param it an Iterator delivering Triples
43     */

44     void add( Iterator it );
45     
46     /**
47         Add all the triples of the given graph into the graph this is handler for.
48         Optionally add g's reified triples.
49         @param g a Graph whose triples are to be added
50         @param withReifications if true, the reified triples of g are added as well
51     */

52     void add( Graph g, boolean withReifications );
53     
54     /**
55         Add all the triples of the given graph into the graph this is handler for.
56         Leave this graph's reifications unchanged.
57         @param g a Graph whose triples are to be added
58     */

59     void add( Graph g );
60     
61     /**
62         Remove all the triples from the graph this is handler for.
63         @param triples an array of triples to remove
64     */

65     void delete( Triple [] triples );
66     
67     /**
68         Remove all the triples in the list from the graph this is handler for.
69         Each element of the List must be a Triple.
70         @param triples a list of triples to remove
71     */

72     void delete( List triples );
73     
74     /**
75         Remove all the triples in the iterator from the graph this is handler for.
76         Each element from the iterator must be a Triple. WARNING. An implementation may
77         have to expand the iterator into a data structure containing all the component
78         elements; hence long iterators may be expensive on store.
79         
80         @param it an iterator over Triple
81     */

82     void delete( Iterator it );
83     
84     /**
85         Remove all the triples of the given graph from the graph this is handler for.
86         Do not change the reifications.
87         @param g a graph whose triples are to be removed
88     */

89     void delete( Graph g );
90     
91     /**
92         Remove all the triples of the given graph from the graph this is handler for.
93         Reified triples may optionally be removed.
94         @param g a graph whose triples are to be removed
95         @param withReifications if true, remove g's reifications from this graph
96     */

97     void delete( Graph g, boolean withReifications );
98
99     /**
100         Remove all the statements from a graph.
101     */

102     void removeAll();
103     
104     /**
105        Remove all triples that would be delivered by find(s, p, o)
106     */

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