KickJava   Java API By Example, From Geeks To Geeks.

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


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

6
7 package com.hp.hpl.jena.graph;
8
9 import com.hp.hpl.jena.shared.*;
10 import com.hp.hpl.jena.util.iterator.*;
11
12 /**
13     This interface represents the type of things that can hold reified triples
14     for a Jena Graph.
15     
16     @author kers
17 */

18
19 public interface Reifier extends GetTriple
20     {
21     /**
22          Answer an iterator over all the reification triples in this Reifier that match
23          <code>m</code>.
24     */

25     ExtendedIterator find( TripleMatch m );
26     
27     /**
28          Answer an iterator over all the reification triples that this Reifier exposes
29          (ie all if Standard, none otherwise) that match m.
30     */

31     ExtendedIterator findExposed( TripleMatch m );
32     
33     /**
34          Answer an iterator over the reification triples of this Reifier, or an empty
35          iterator - if showHidden is false, only the exposed triples, otherwise only
36          the concealed ones.
37     */

38     ExtendedIterator findEither( TripleMatch m, boolean showHidden );
39     
40     /**
41          Answer the number of exposed reification quadlets held in this reifier.
42     */

43     int size();
44     
45     /**
46         Answer this reifier's style.
47     */

48     ReificationStyle getStyle();
49     
50     /**
51         get the Graph which uses this reifier.
52     */

53     Graph getParentGraph();
54     
55     /**
56         note the triple _t_ as reified using _n_ as its representing node.
57         If _n_ is already reifying something, a AlreadyReifiedException is thrown.
58     */

59     Node reifyAs( Node n, Triple t );
60     
61     /**
62         true iff _n_ is associated with some triple.
63     */

64     boolean hasTriple( Node n );
65     
66     /**
67         @return true iff there's > 0 mappings to this triple
68     */

69     boolean hasTriple( Triple t );
70     
71     /**
72         return an iterator over all the nodes that are reifiying something in
73         this reifier.
74     */

75     ExtendedIterator allNodes();
76     
77     /**
78         return an iterator over all the nodes that are reifiying t in
79         this reifier.
80     */

81     ExtendedIterator allNodes( Triple t );
82     
83     /**
84         remove any existing binding for _n_; hasNode(n) will return false
85         and getTriple(n) will return null. This only removes *unique, single* bindings.
86     */

87     void remove( Node n, Triple t );
88     
89     /**
90         remove all bindings which map to this triple.
91     */

92     void remove( Triple t );
93     
94     /**
95         true iff the Reifier has handled an add of the triple _t_.
96     */

97     boolean handledAdd( Triple t );
98     
99     /**
100         true iff the Reifier has handled a remove of the triple _t_.
101     */

102     boolean handledRemove( Triple t );
103
104     /**
105         The reifier will no longer be used. Further operations on it are not defined
106         by this interface.
107     */

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

140
Popular Tags