KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.apache.ojb.broker;
2
3 import java.io.Serializable JavaDoc;
4
5 import org.apache.ojb.broker.util.collections.RemovalAwareList;
6
7
8 /**
9  * represents a product group containing a set of Articles.
10  * @see Article
11  */

12 public class ProductGroupWithRemovalAwareCollection implements Serializable JavaDoc
13 {
14
15     /** collection containing all articles of a given product group*/
16     private RemovalAwareList allArticlesInGroup;
17
18     /** the unique id of a product group*/
19     private int groupId;
20
21     /** the name of a group*/
22     private String JavaDoc groupName;
23
24
25     /** return group id*/
26     public int getId()
27     {
28         return groupId;
29     }
30
31
32     /** return groupname*/
33     public String JavaDoc getName()
34     {
35         return groupName;
36     }
37
38     public ProductGroupWithRemovalAwareCollection()
39     {
40     }
41
42     /** return List of all Articles in productgroup*/
43     public RemovalAwareList getAllArticles()
44     {
45         return allArticlesInGroup;
46     }
47     
48     public synchronized void add(Article art)
49     {
50         if (allArticlesInGroup == null)
51         {
52             allArticlesInGroup = new RemovalAwareList();
53         }
54         this.allArticlesInGroup.add(art);
55     }
56
57     /** set group id*/
58     public void setId(int newValue)
59     {
60         groupId = newValue;
61     }
62
63     /**
64      * Sets the allArticlesInGroup.
65      * @param allArticlesInGroup The allArticlesInGroup to set
66      */

67     public void setAllArticlesInGroup(RemovalAwareList allArticlesInGroup)
68     {
69         this.allArticlesInGroup = allArticlesInGroup;
70     }
71
72
73     /**
74      * Gets the groupId.
75      * @return Returns a int
76      */

77     public int getGroupId()
78     {
79         return groupId;
80     }
81
82     /**
83      * Sets the groupId.
84      * @param groupId The groupId to set
85      */

86     public void setGroupId(int groupId)
87     {
88         this.groupId = groupId;
89     }
90
91     /**
92      * Gets the groupName.
93      * @return Returns a String
94      */

95     public String JavaDoc getGroupName()
96     {
97         return groupName;
98     }
99
100     /**
101      * Sets the groupName.
102      * @param groupName The groupName to set
103      */

104     public void setGroupName(String JavaDoc groupName)
105     {
106         this.groupName = groupName;
107     }
108
109 }
110
Popular Tags