KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > graph > impl > ReifierTripleMap


1 /*
2  (c) Copyright 2004, 2005 Hewlett-Packard Development Company, LP, all rights reserved.
3  [See end of file]
4  $Id: ReifierTripleMap.java,v 1.5 2005/02/21 11:52:10 andy_seaborne Exp $
5  */

6
7 package com.hp.hpl.jena.graph.impl;
8
9 import com.hp.hpl.jena.graph.*;
10 import com.hp.hpl.jena.util.iterator.ExtendedIterator;
11
12 /**
13      ReifierTripleMap - an interface that describes how SimpleReifier manages
14      complete reified statements.
15      @author kers
16 */

17 public interface ReifierTripleMap
18     {
19     /**
20          Answer the triple (ie reified statement) that is bound to this node, or
21          null if there's no such triple.
22     */

23     public abstract Triple getTriple( Node tag );
24
25     /**
26          Answer true iff we have a reified triple <code>t</code> -- ie, getTriple would
27          not return <code>null</code>.
28     */

29     public abstract boolean hasTriple( Triple t );
30
31     /**
32          Bind the triple <code>value</code> to the node <code>key</code> and
33          answer that triple. An implementation may assume that <code>key</code>
34          is not already bound.
35     */

36     public abstract Triple putTriple( Node key, Triple value );
37
38     /**
39          Unbind <code>key</code> from any triple already bound to it.
40     */

41     public abstract void removeTriple( Node key );
42
43     /**
44          <code>key</code> should already be bound to <code>triple</code>; that
45          binding is removed.
46     */

47     public abstract void removeTriple( Node key, Triple value );
48
49     /**
50          Remove every binding tag -> <code>triple</code>.
51     */

52     public abstract void removeTriple( Triple triple );
53     
54     /**
55          Answer an iterator over all the quadlets that match <code>m</code> that
56          correspond to complete reified triples held in this map.
57     */

58     public ExtendedIterator find( TripleMatch m );
59     
60     /**
61          Answer the number of quadlets in this map.
62     */

63     public int size();
64
65     /**
66          Answer an iterator over all the bound tags in this map.
67     */

68     public abstract ExtendedIterator tagIterator();
69
70     /**
71          Answer an iterator over all the tags in this map that are bound to
72          <code>t</code>.
73     */

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