1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.dbforms.event.eventtype;
25
26 import java.util.ArrayList;
27
28
29
30
31
32 /***
33 * Abstract composite EventTypeStrategy class.
34 *
35 * @author Luca Fossato
36 *
37 */
38 public abstract class AbstractCompositeEventTypeStrategy implements EventTypeStrategy {
39 /*** the list of EventTypeStrategy objects */
40 protected ArrayList strategyList = new ArrayList();
41
42 /***
43 * Gets the child EventTypeStrategy having the input index
44 *
45 * @param index DOCUMENT ME!
46 *
47 * @return the child EventTypeStrategy having the input index
48 */
49 public EventTypeStrategy getChild(int index) {
50 return (EventTypeStrategy) strategyList.get(index);
51 }
52
53
54 /***
55 * Adds an EventTypeStrategy object to the Strategy list
56 *
57 * @param strategy the EventTypeStrategy object to add to
58 */
59 public void add(EventTypeStrategy strategy) {
60 strategyList.add(strategy);
61 }
62
63
64 /***
65 * Remove an EventTypeStrategy object to the Strategy list
66 *
67 * @param strategy the EventTypeStrategy object to remove to
68 *
69 * @return true if the object had removed from the list; false otherwise
70 */
71 public boolean remove(EventTypeStrategy strategy) {
72 return strategyList.remove(strategy);
73 }
74 }