KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.apache.ojb.broker;
2
3
4 /** represents a product group containing a set of Articles.
5  * @see Article
6  */

7 public class ProductGroupWithTypedCollection implements java.io.Serializable JavaDoc
8 {
9
10     /** return group id*/
11     public int getId()
12     {
13         return groupId;
14     }
15
16     /**return string representation*/
17     public String JavaDoc toString()
18     {
19         return
20                 "----\n" +
21                 "group Id: " + groupId + "\n" +
22                 "name: " + groupName + "\n" +
23                 "description: " + description + "\n" +
24                 "articles in group: " + allArticlesInGroup;
25     }
26
27     /** return groupname*/
28     public String JavaDoc getName()
29     {
30         return groupName;
31     }
32
33     /** collection containing all articles of a given product group*/
34     private ArticleCollection allArticlesInGroup;
35     /** a textual description of the group*/
36     private String JavaDoc description;
37     /** the unique id of a product group*/
38     private int groupId;
39     /** the name of a group*/
40     private String JavaDoc groupName;
41
42     public ProductGroupWithTypedCollection(int pGroupId, String JavaDoc pGroupName, String JavaDoc pDescription)
43     {
44         groupId = pGroupId;
45         groupName = pGroupName;
46         description = pDescription;
47     }
48
49     public ProductGroupWithTypedCollection()
50     {
51     }
52
53
54     /** return List of all Articles in productgroup*/
55     public ArticleCollection getAllArticles()
56     {
57         return allArticlesInGroup;
58     }
59
60     /** set group id*/
61     public void setId(int newValue)
62     {
63         groupId = newValue;
64     }
65     /**
66      * Gets the allArticlesInGroup.
67      * @return Returns a ArticleCollection
68      */

69     public ArticleCollection getAllArticlesInGroup()
70     {
71         return allArticlesInGroup;
72     }
73
74     /**
75      * Sets the allArticlesInGroup.
76      * @param allArticlesInGroup The allArticlesInGroup to set
77      */

78     public void setAllArticlesInGroup(ArticleCollection allArticlesInGroup)
79     {
80         this.allArticlesInGroup = allArticlesInGroup;
81     }
82
83     /**
84      * Gets the description.
85      * @return Returns a String
86      */

87     public String JavaDoc getDescription()
88     {
89         return description;
90     }
91
92     /**
93      * Sets the description.
94      * @param description The description to set
95      */

96     public void setDescription(String JavaDoc description)
97     {
98         this.description = description;
99     }
100
101     /**
102      * Gets the groupId.
103      * @return Returns a int
104      */

105     public int getGroupId()
106     {
107         return groupId;
108     }
109
110     /**
111      * Sets the groupId.
112      * @param groupId The groupId to set
113      */

114     public void setGroupId(int groupId)
115     {
116         this.groupId = groupId;
117     }
118
119     /**
120      * Gets the groupName.
121      * @return Returns a String
122      */

123     public String JavaDoc getGroupName()
124     {
125         return groupName;
126     }
127
128     /**
129      * Sets the groupName.
130      * @param groupName The groupName to set
131      */

132     public void setGroupName(String JavaDoc groupName)
133     {
134         this.groupName = groupName;
135     }
136
137 }
138
Popular Tags