capture
[rrq/gorite.git] / com / intendico / data / Store.java
1 /*********************************************************************
2 Copyright 2012, Ralph Ronnquist.
3
4 This file is part of GORITE.
5
6 GORITE is free software: you can redistribute it and/or modify it
7 under the terms of the Lesser GNU General Public License as published
8 by the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 GORITE is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14 License for more details.
15
16 You should have received a copy of the Lesser GNU General Public
17 License along with GORITE.  If not, see <http://www.gnu.org/licenses/>.
18 **********************************************************************/
19
20 package com.intendico.data;
21
22 import java.util.Observable;
23
24 /**
25  * This interface defines the requirements of a data store, which is
26  * an object that contains "tuples" represented as Object arrays. Note
27  * that stores typically should implement {@link Inquirable} as well.
28  */
29 public interface Store {
30
31     /**
32      * Interface method for adding a tuple of values to this
33      * Store. The method returns true if the store was modified due to
34      * this action, otherwise false.
35      */
36     public boolean add(Object/*...*/ [] values) throws Exception ;
37
38     /**
39      * Interface method for removing a tuple of values from this
40      * Store. The method returns true if the store was modified due to
41      * this action, otherwise false.
42      */
43     public boolean remove(Object/*...*/ [] values) throws Exception ;
44
45     /**
46      * Interface method for clearing this store of all its data.
47      */
48     public void clear() throws Exception ;
49
50     /**
51      * Interface method for returning an Observable that notifies
52      * about subsequent changes to the Store.
53      */
54     public Observable getMonitor();
55 }