Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: ojb/broker/ManageableCollection.java


1   /*
2    * ObJectRelationalBridge - Bridging Java Objects and Relational Databases
3    * http://objectbridge.sourceforge.net
4    * Copyright (C) 2000, 2001 Thomas Mahler, et al.
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.1 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  package ojb.broker;
21  
22  import java.util.Iterator;
23  
24  /**
25   * OJB can handle java.util.Collection as well as user defined collection classes as collection attributes
26   * in persistent classes. In order to collaborate with the OJB mechanisms these collection must provide a minimum
27   * protocol as defined by this interface ManageableCollection.
28   * The methods have a prefix "ojb" that indicates that these methods are "technical" methods, required
29   * by OJB and not to be used in business code.
30   *
31   * @author: Thomas Mahler
32   */
33  public interface ManageableCollection extends java.io.Serializable
34  {
35  
36      /**
37       * add a single Object to the Collection. This method is used during reading Collection elements
38       * from the database. Thus it is is save to cast anObject to the underlying element type of the
39       * collection.
40       */
41      void ojbAdd(Object anObject);
42  
43      /**
44       * adds a Collection to this collection. Used in reading Extents from the Database.
45       * Thus it is save to cast otherCollection to this.getClass().
46       */
47      void ojbAddAll(ManageableCollection otherCollection);
48  
49      /**
50       * returns an Iterator over all elements in the collection. Used during store and delete Operations.
51       * If the implementor does not return an iterator over ALL elements, OJB cannot store and delete all elements properly.
52       *
53       */
54      Iterator ojbIterator();
55  }