01: package org.apache.ojb.broker;
02:
03: import org.apache.ojb.broker.ManageableCollection;
04:
05: import java.util.Vector;
06:
07: /**
08: * Insert the type's description here.
09: * Creation date: (18.02.2001 16:09:24)
10: * @author Thomas Mahler
11: */
12: public class ArticleCollection implements ManageableCollection,
13: java.io.Serializable {
14: private Vector elements;
15:
16: /**
17: * ArticleCollection constructor comment.
18: */
19: public ArticleCollection() {
20: super ();
21: elements = new Vector();
22: }
23:
24: public void add(InterfaceArticle article) {
25: if (elements == null)
26: elements = new Vector();
27: elements.add(article);
28: }
29:
30: public InterfaceArticle get(int index) {
31: return (InterfaceArticle) elements.get(index);
32: }
33:
34: /**
35: * add method comment.
36: */
37: public void ojbAdd(java.lang.Object anObject) {
38: elements.add(anObject);
39: }
40:
41: /**
42: * addAll method comment.
43: */
44: public void ojbAddAll(
45: org.apache.ojb.broker.ManageableCollection otherCollection) {
46: elements.addAll(((ArticleCollection) otherCollection).elements);
47: }
48:
49: /**
50: * ojbIterator method comment.
51: */
52: public java.util.Iterator ojbIterator() {
53: return elements.iterator();
54: }
55:
56: public void afterStore(PersistenceBroker broker)
57: throws PersistenceBrokerException {
58: }
59:
60: public int size() {
61: return elements.size();
62: }
63:
64: public String toString() {
65: return elements.toString();
66: }
67: }
|