KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  (c) Copyright 2004, 2005 Hewlett-Packard Development Company, LP, all rights reserved.
3  [See end of file]
4  $Id: TripleStore.java,v 1.5 2005/02/21 11:52:11 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      TripleStore - interface for bulk storage of triples used in composed graphs.
14      @author kers
15 */

16 public interface TripleStore
17     {
18     /**
19          Destroy this triple store - discard the indexes.
20     */

21     public abstract void close();
22
23     /**
24          Add a triple to this triple store.
25     */

26     public abstract void add( Triple t );
27
28     /**
29          Remove a triple from this triple store.
30     */

31     public abstract void delete( Triple t );
32
33     /**
34          Answer the size (number of triples) of this triple store.
35     */

36     public abstract int size();
37
38     /**
39          Answer true iff this triple store is empty.
40     */

41     public abstract boolean isEmpty();
42
43     /**
44          Answer true iff this triple store contains the (concrete) triple <code>t</code>.
45     */

46     public abstract boolean contains( Triple t );
47
48     /**
49          Answer an setwise iterator over all the subjects of triples in this store.
50     */

51     public ExtendedIterator listSubjects();
52     
53     /**
54          Answer an iterator over all the predicates of triples in this store.
55     */

56     public ExtendedIterator listPredicates();
57     
58     /**
59          Answer an setwise iterator over all the objects of triples in this store.
60     */

61     public ExtendedIterator listObjects();
62     
63     /**
64          Answer an ExtendedIterator returning all the triples from this store that
65          match the pattern <code>m = (S, P, O)</code>.
66     */

67     public abstract ExtendedIterator find( TripleMatch tm );
68
69     /**
70         Clear this store, ie remove all triples from it.
71     */

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