1 | /* |
2 | *Copyright 2007, IPD, SDQ, University of Karlsruhe |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.repository.navigator; |
5 | |
6 | import java.util.Collection; |
7 | import java.util.LinkedList; |
8 | |
9 | /** |
10 | * @generated |
11 | */ |
12 | public class PalladioComponentModelNavigatorGroup extends |
13 | PalladioComponentModelAbstractNavigatorItem { |
14 | |
15 | /** |
16 | * @generated |
17 | */ |
18 | private String myGroupName; |
19 | |
20 | /** |
21 | * @generated |
22 | */ |
23 | private String myIcon; |
24 | |
25 | /** |
26 | * @generated |
27 | */ |
28 | private Collection myChildren = new LinkedList(); |
29 | |
30 | /** |
31 | * @generated |
32 | */ |
33 | PalladioComponentModelNavigatorGroup(String groupName, String icon, |
34 | Object parent) { |
35 | super(parent); |
36 | myGroupName = groupName; |
37 | myIcon = icon; |
38 | } |
39 | |
40 | /** |
41 | * @generated |
42 | */ |
43 | public String getGroupName() { |
44 | return myGroupName; |
45 | } |
46 | |
47 | /** |
48 | * @generated |
49 | */ |
50 | public String getIcon() { |
51 | return myIcon; |
52 | } |
53 | |
54 | /** |
55 | * @generated |
56 | */ |
57 | public Object[] getChildren() { |
58 | return myChildren.toArray(); |
59 | } |
60 | |
61 | /** |
62 | * @generated |
63 | */ |
64 | public void addChildren(Collection children) { |
65 | myChildren.addAll(children); |
66 | } |
67 | |
68 | /** |
69 | * @generated |
70 | */ |
71 | public void addChild(Object child) { |
72 | myChildren.add(child); |
73 | } |
74 | |
75 | /** |
76 | * @generated |
77 | */ |
78 | public boolean isEmpty() { |
79 | return myChildren.size() == 0; |
80 | } |
81 | |
82 | /** |
83 | * @generated |
84 | */ |
85 | public boolean equals(Object obj) { |
86 | if (obj instanceof de.uka.ipd.sdq.pcm.gmf.repository.navigator.PalladioComponentModelNavigatorGroup) { |
87 | de.uka.ipd.sdq.pcm.gmf.repository.navigator.PalladioComponentModelNavigatorGroup anotherGroup = (de.uka.ipd.sdq.pcm.gmf.repository.navigator.PalladioComponentModelNavigatorGroup) obj; |
88 | if (getGroupName().equals(anotherGroup.getGroupName())) { |
89 | return getParent().equals(anotherGroup.getParent()); |
90 | } |
91 | } |
92 | return super.equals(obj); |
93 | } |
94 | |
95 | /** |
96 | * @generated |
97 | */ |
98 | public int hashCode() { |
99 | return getGroupName().hashCode(); |
100 | } |
101 | |
102 | } |