KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jorm > api > PGenClassAccessor


1 /**
2  * JORM: an implementation of a generic mapping system for persistent Java
3  * objects. Two mapping are supported: to RDBMS and to binary files.
4  * Copyright (C) 2001-2003 France Telecom R&D - INRIA
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * Contact: jorm-team@objectweb.org
21  *
22  */

23
24 package org.objectweb.jorm.api;
25
26 import java.util.Iterator JavaDoc;
27
28 /**
29  * The <b>PGenClassAccessor</b> interface defines the Accessor for all
30  * generic classes. These methods are the same for all generic classes, they
31  * are defined by this unique interface that extends the <code>PAccessor</code>
32  * interface. Notice that all accessor methods are also prefixed with "pa".
33  * It is also a factory of PIndexedElem that defines the object used by the
34  * bindings in order to store the generic class element, and that are
35  * implemented by generic class MI.
36  * @author R. Basset, P. Dechamboux
37  */

38 public interface PGenClassAccessor extends PAccessor, PIndexedElemFactory {
39     /**
40      * It passes one of the elements extracted from the data store to the
41      * memory instance.
42      * @param elem the PIndexElenm to be added to the memory instance.
43      * @param conn the connection to the DS
44      */

45     void paAdd(PIndexedElem elem, Object JavaDoc conn) throws PException;
46
47     /**
48      * It tells if the generic class memory instance supports delta
49      * modifications, which means that paadded, padeleted and pamodified are
50      * supported.
51      * @return It return true is delta is supported by the memory instance.
52      */

53     boolean paDeltaSupported();
54
55     /**
56      * It retrieves the number of elements contained within the generic class
57      * memory instance before storing it. This is the number of element that
58      * should remain into the DSI after writing.
59      * @return The number of elements within the memory instance of this
60      * generic class.
61      */

62     int paGetNbElem();
63
64     /**
65      * It returns an Iterator over the elements of a generic class memory
66      * instance. It scans all elements of the MI, their modification flag be
67      * ELEM_CREATED, ELEM_DELETED, ELEM_MODIFIED or ELEM_UNMODIFIED. The
68      * PBinding can then store them into the related DSI.
69      * @return The Iterator over the memory instance elements.
70      */

71     Iterator JavaDoc paIterator();
72
73     /**
74      * It passes the number of elements contained within the generic class DSI
75      * to the memory instance. This is done just before lements are passed to
76      * the memory instance using the paAdd method.
77      * @param nbelem The number of elements within this generic class DSI.
78      */

79     void paSetNbElem(int nbelem);
80 }
81
Popular Tags