Subversion Repositories SmartDukaan

Rev

Rev 10 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10 Rev 51
Line 7... Line 7...
7
import java.util.List;
7
import java.util.List;
8
 
8
 
9
import in.shop2020.metamodel.util.ReusableMetaModelComponent;
9
import in.shop2020.metamodel.util.ReusableMetaModelComponent;
10
 
10
 
11
/**
11
/**
-
 
12
 * Category class is the center of all definition classes. Represents product 
-
 
13
 * categories in shop2020 online product catalog. Other classes under 
-
 
14
 * definitions package define different elements of a Category.
12
 * 
15
 * 
13
 * @author naveen
16
 * @author naveen
14
 *
17
 *
15
 */
18
 */
16
public class Category extends ReusableMetaModelComponent {
19
public class Category extends ReusableMetaModelComponent {
17
	/**
20
	/**
18
	 * 
21
	 * 
19
	 */
22
	 */
20
	private static final long serialVersionUID = 1L;
23
	private static final long serialVersionUID = 1L;
-
 
24
	
-
 
25
	/**
-
 
26
	 * Editor provided intuitive label for the category
-
 
27
	 */
21
	private String label;
28
	private String label;
-
 
29
	
-
 
30
	/**
-
 
31
	 * Editor's comments
-
 
32
	 */
22
	private String description;
33
	private String description;
-
 
34
	
-
 
35
	/**
-
 
36
	 * List CategorySlideDefintion objects that define while slides define the 
-
 
37
	 * category
-
 
38
	 */
23
	private List<CategorySlideDefinition> categorySlideDefintions;
39
	private List<CategorySlideDefinition> categorySlideDefintions;
-
 
40
	
-
 
41
	/**
-
 
42
	 * Parent category
-
 
43
	 */
24
	private Category parentCategory;
44
	private Category parentCategory;
-
 
45
	
-
 
46
	/**
-
 
47
	 * List of childrent categories
-
 
48
	 */
25
	private List<Category> childrenCategory;
49
	private List<Category> childrenCategory;
26
	
50
	
27
	/**
51
	/**
28
	 * 
52
	 *  
29
	 * @param newID
53
	 * @param newID Unique identifier for the category
30
	 */
54
	 */
31
	public Category(long newID) {
55
	public Category(long newID) {
32
		super(newID);
56
		super(newID);
33
	}
57
	}
34
	
58
	
Line 40... Line 64...
40
		return this.label;
64
		return this.label;
41
	}
65
	}
42
	
66
	
43
	/**
67
	/**
44
	 * 
68
	 * 
45
	 * @param value
69
	 * @param label to set
46
	 */
70
	 */
47
	public void setLabel(String value) {
71
	public void setLabel(String value) {
48
		this.label = value;
72
		this.label = value;
49
	}
73
	}
50
 
74
 
51
	/**
75
	/**
52
	 * 
76
	 * 
53
	 * @return description
77
	 * @return description 
54
	 */
78
	 */
55
	public String getDescription() {
79
	public String getDescription() {
56
		return this.description;
80
		return this.description;
57
	}
81
	}
58
	
82
	
59
	/**
83
	/**
60
	 * 
84
	 * 
61
	 * @param value
85
	 * @param description to set
62
	 */
86
	 */
63
	public void setDescription(String value) {
87
	public void setDescription(String value) {
64
		this.description = value;
88
		this.description = value;
65
	}
89
	}
66
 
90
 
Line 78... Line 102...
78
			List<CategorySlideDefinition> categorySlideDefintions) {
102
			List<CategorySlideDefinition> categorySlideDefintions) {
79
		this.categorySlideDefintions = categorySlideDefintions;
103
		this.categorySlideDefintions = categorySlideDefintions;
80
	}
104
	}
81
	
105
	
82
	/**
106
	/**
-
 
107
	 * Convenient method to add new CategorySlideDefintion objects
83
	 * 
108
	 * 
84
	 * @param categoryDefinition
109
	 * @param categoryDefinition
85
	 */
110
	 */
86
	public void addCategorySlideDefintion(CategorySlideDefinition categoryDefinition) {
111
	public void addCategorySlideDefintion(CategorySlideDefinition categoryDefinition) {
87
		if(this.categorySlideDefintions == null) {
112
		if(this.categorySlideDefintions == null) {
Line 110... Line 135...
110
	public void setChildrenCategory(List<Category> childrenCategory) {
135
	public void setChildrenCategory(List<Category> childrenCategory) {
111
		this.childrenCategory = childrenCategory;
136
		this.childrenCategory = childrenCategory;
112
	}
137
	}
113
 
138
 
114
	/**
139
	/**
-
 
140
	 * Convenient method to add new children categories 
-
 
141
	 * 
115
	 * @param childrenCategory the childrenCategory to set
142
	 * @param childrenCategory the childrenCategory to set
116
	 */
143
	 */
117
	public void addChild(Category child) {
144
	public void addChild(Category child) {
118
		if(this.childrenCategory == null) {
145
		if(this.childrenCategory == null) {
119
			this.childrenCategory = new ArrayList<Category>();
146
			this.childrenCategory = new ArrayList<Category>();