KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ojb > broker > ArticleCollection


1 package org.apache.ojb.broker;
2
3 import org.apache.ojb.broker.ManageableCollection;
4
5 import java.util.Vector JavaDoc;
6
7 /**
8  * Insert the type's description here.
9  * Creation date: (18.02.2001 16:09:24)
10  * @author Thomas Mahler
11  */

12 public class ArticleCollection implements ManageableCollection, java.io.Serializable JavaDoc
13 {
14     private Vector JavaDoc elements;
15
16     /**
17      * ArticleCollection constructor comment.
18      */

19     public ArticleCollection()
20     {
21         super();
22         elements = new Vector JavaDoc();
23     }
24
25     public void add(InterfaceArticle article)
26     {
27         if (elements == null)
28             elements = new Vector JavaDoc();
29         elements.add(article);
30     }
31
32     public InterfaceArticle get(int index)
33     {
34         return (InterfaceArticle) elements.get(index);
35     }
36
37     /**
38      * add method comment.
39      */

40     public void ojbAdd(java.lang.Object JavaDoc anObject)
41     {
42         elements.add(anObject);
43     }
44
45     /**
46      * addAll method comment.
47      */

48     public void ojbAddAll(org.apache.ojb.broker.ManageableCollection otherCollection)
49     {
50         elements.addAll(((ArticleCollection) otherCollection).elements);
51     }
52
53     /**
54      * ojbIterator method comment.
55      */

56     public java.util.Iterator JavaDoc ojbIterator()
57     {
58         return elements.iterator();
59     }
60
61     public void afterStore(PersistenceBroker broker) throws PersistenceBrokerException
62     {
63     }
64
65     public int size()
66     {
67         return elements.size();
68     }
69
70     public String JavaDoc toString()
71     {
72         return elements.toString();
73     }
74 }
75
Popular Tags