@@ -65,6 +65,18 @@ FamixTParametricEntity >> addGenericParameter: anObject [
65
65
^ self genericParameters add: anObject
66
66
]
67
67
68
+ { #category : #accessing }
69
+ FamixTParametricEntity >> allTypeParameters [
70
+
71
+ | collection |
72
+ collection := OrderedCollection new :
73
+ self concreteParameters + self genericParameters size.
74
+ collection
75
+ addAll: self concreteParameters;
76
+ addAll: self genericParameters.
77
+ ^ collection
78
+ ]
79
+
68
80
{ #category : #accessing }
69
81
FamixTParametricEntity >> concreteParameters [
70
82
" Relation named: #concreteParameters type: #FamixTConcreteParameterType opposite: #concreteEntities"
@@ -133,40 +145,25 @@ FamixTParametricEntity >> genericParameters: anObject [
133
145
134
146
{ #category : #accessing }
135
147
FamixTParametricEntity >> isConcreteEntity [
136
- " An Entity is generic if it has at least one ParameterType"
148
+ " An Entity is generic if it has at least one ParameterType"
137
149
138
- | param res |
139
- res := true .
140
- param := OrderedCollection new .
141
- param addAll: self genericParameters.
142
- param addAll: self concreteParameters.
143
- param do: [ :p | p isParameterType
144
- ifTrue: [ res := false ] ].
145
- ^ res.
146
-
147
- " self genericParameters ifNotEmpty: [ ^ false ]
148
- ifEmpty: [^ true]."
150
+ ^ self isGenericEntity not
149
151
]
150
152
151
153
{ #category : #accessing }
152
154
FamixTParametricEntity >> isGenericEntity [
153
- " An Entity is generic if it has at least one ParameterType"
155
+ " An Entity is generic if it has at least one ParameterType"
154
156
155
- | param res |
156
- res := false .
157
- param := OrderedCollection new .
158
- param addAll: self genericParameters.
159
- param addAll: self concreteParameters.
160
- param do: [ :p | p isParameterType
161
- ifTrue: [ res := true ] ].
162
- ^ res.
157
+ self genericParameters ifNotEmpty: [ ^ true ].
158
+ ^ self concreteParameters anySatisfy: [ :p | p isParameterType ]
163
159
]
164
160
165
161
{ #category : #accessing }
166
- FamixTParametricEntity >> parametricParameters [
162
+ FamixTParametricEntity >> rootGenericEntity [
167
163
168
- |collection |
169
- collection := OrderedCollection new .
170
- collection addAll: self concreteParameters , self genericParameters .
171
- ^ collection
164
+ | root |
165
+ root := self .
166
+ [ root genericEntity isNotNil ] whileTrue: [
167
+ root := root genericEntity ].
168
+ ^ root
172
169
]
0 commit comments