/
MultiplicityElement.java
418 lines (387 loc) · 16.4 KB
/
MultiplicityElement.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
/*
* Copyright (c) 2005, 2018 IBM Corporation, CEA, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* IBM - initial API and implementation
* Kenn Hussey (CEA) - 327039, 351774, 418466, 451350, 485756
* Christian W. Damus (CEA) - 251963
* Kenn Hussey - 535301
*
*/
package org.eclipse.uml2.uml;
import java.util.Map;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.ecore.EClass;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Multiplicity Element</b></em>'.
* <!-- end-user-doc -->
*
* <!-- begin-model-doc -->
* A multiplicity is a definition of an inclusive interval of non-negative integers beginning with a lower bound and ending with a (possibly infinite) upper bound. A MultiplicityElement embeds this information to specify the allowable cardinalities for an instantiation of the Element.
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link org.eclipse.uml2.uml.MultiplicityElement#isOrdered <em>Is Ordered</em>}</li>
* <li>{@link org.eclipse.uml2.uml.MultiplicityElement#isUnique <em>Is Unique</em>}</li>
* <li>{@link org.eclipse.uml2.uml.MultiplicityElement#getLower <em>Lower</em>}</li>
* <li>{@link org.eclipse.uml2.uml.MultiplicityElement#getLowerValue <em>Lower Value</em>}</li>
* <li>{@link org.eclipse.uml2.uml.MultiplicityElement#getUpper <em>Upper</em>}</li>
* <li>{@link org.eclipse.uml2.uml.MultiplicityElement#getUpperValue <em>Upper Value</em>}</li>
* </ul>
*
* @see org.eclipse.uml2.uml.UMLPackage#getMultiplicityElement()
* @model abstract="true"
* @generated
*/
public interface MultiplicityElement
extends Element {
/**
* Returns the value of the '<em><b>Is Ordered</b></em>' attribute.
* The default value is <code>"false"</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* For a multivalued multiplicity, this attribute specifies whether the values in an instantiation of this MultiplicityElement are sequentially ordered.
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @return the value of the '<em>Is Ordered</em>' attribute.
* @see #setIsOrdered(boolean)
* @see org.eclipse.uml2.uml.UMLPackage#getMultiplicityElement_IsOrdered()
* @model default="false" dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false"
* @generated
*/
boolean isOrdered();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.MultiplicityElement#isOrdered <em>Is Ordered</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Is Ordered</em>' attribute.
* @see #isOrdered()
* @generated
*/
void setIsOrdered(boolean value);
/**
* Returns the value of the '<em><b>Is Unique</b></em>' attribute.
* The default value is <code>"true"</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* For a multivalued multiplicity, this attributes specifies whether the values in an instantiation of this MultiplicityElement are unique.
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @return the value of the '<em>Is Unique</em>' attribute.
* @see #setIsUnique(boolean)
* @see org.eclipse.uml2.uml.UMLPackage#getMultiplicityElement_IsUnique()
* @model default="true" dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false"
* @generated
*/
boolean isUnique();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.MultiplicityElement#isUnique <em>Is Unique</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Is Unique</em>' attribute.
* @see #isUnique()
* @generated
*/
void setIsUnique(boolean value);
/**
* Returns the value of the '<em><b>Upper</b></em>' attribute.
* The default value is <code>"1"</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The upper bound of the multiplicity interval.
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @return the value of the '<em>Upper</em>' attribute.
* @see #setUpper(int)
* @see org.eclipse.uml2.uml.UMLPackage#getMultiplicityElement_Upper()
* @model default="1" dataType="org.eclipse.uml2.types.UnlimitedNatural" required="true" transient="true" volatile="true" derived="true" ordered="false"
* @generated
*/
int getUpper();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.MultiplicityElement#getUpper <em>Upper</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Upper</em>' attribute.
* @see #getUpper()
* @generated
*/
void setUpper(int value);
/**
* Returns the value of the '<em><b>Lower</b></em>' attribute.
* The default value is <code>"1"</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The lower bound of the multiplicity interval.
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @return the value of the '<em>Lower</em>' attribute.
* @see #setLower(int)
* @see org.eclipse.uml2.uml.UMLPackage#getMultiplicityElement_Lower()
* @model default="1" dataType="org.eclipse.uml2.types.Integer" transient="true" volatile="true" derived="true" ordered="false"
* @generated
*/
int getLower();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.MultiplicityElement#getLower <em>Lower</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Lower</em>' attribute.
* @see #getLower()
* @generated
*/
void setLower(int value);
/**
* Returns the value of the '<em><b>Upper Value</b></em>' containment reference.
* <p>
* This feature subsets the following features:
* </p>
* <ul>
* <li>'{@link org.eclipse.uml2.uml.Element#getOwnedElements() <em>Owned Element</em>}'</li>
* </ul>
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The specification of the upper bound for this multiplicity.
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @return the value of the '<em>Upper Value</em>' containment reference.
* @see #setUpperValue(ValueSpecification)
* @see org.eclipse.uml2.uml.UMLPackage#getMultiplicityElement_UpperValue()
* @model containment="true" resolveProxies="true" ordered="false"
* @generated
*/
ValueSpecification getUpperValue();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.MultiplicityElement#getUpperValue <em>Upper Value</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Upper Value</em>' containment reference.
* @see #getUpperValue()
* @generated
*/
void setUpperValue(ValueSpecification value);
/**
* Creates a new {@link org.eclipse.uml2.uml.ValueSpecification}, with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', and sets the '<em><b>Upper Value</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' for the new {@link org.eclipse.uml2.uml.ValueSpecification}, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' for the new {@link org.eclipse.uml2.uml.ValueSpecification}, or <code>null</code>.
* @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.ValueSpecification} to create.
* @return The new {@link org.eclipse.uml2.uml.ValueSpecification}.
* @see #getUpperValue()
* @generated
*/
ValueSpecification createUpperValue(String name, Type type, EClass eClass);
/**
* Returns the value of the '<em><b>Lower Value</b></em>' containment reference.
* <p>
* This feature subsets the following features:
* </p>
* <ul>
* <li>'{@link org.eclipse.uml2.uml.Element#getOwnedElements() <em>Owned Element</em>}'</li>
* </ul>
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The specification of the lower bound for this multiplicity.
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @return the value of the '<em>Lower Value</em>' containment reference.
* @see #setLowerValue(ValueSpecification)
* @see org.eclipse.uml2.uml.UMLPackage#getMultiplicityElement_LowerValue()
* @model containment="true" resolveProxies="true" ordered="false"
* @generated
*/
ValueSpecification getLowerValue();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.MultiplicityElement#getLowerValue <em>Lower Value</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Lower Value</em>' containment reference.
* @see #getLowerValue()
* @generated
*/
void setLowerValue(ValueSpecification value);
/**
* Creates a new {@link org.eclipse.uml2.uml.ValueSpecification}, with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', and sets the '<em><b>Lower Value</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' for the new {@link org.eclipse.uml2.uml.ValueSpecification}, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' for the new {@link org.eclipse.uml2.uml.ValueSpecification}, or <code>null</code>.
* @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.ValueSpecification} to create.
* @return The new {@link org.eclipse.uml2.uml.ValueSpecification}.
* @see #getLowerValue()
* @generated
*/
ValueSpecification createLowerValue(String name, Type type, EClass eClass);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The lower bound must be a non-negative integer literal.
* lowerBound() >= 0
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateLowerGe0(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The upper bound must be greater than or equal to the lower bound.
* upperBound() >= lowerBound()
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateUpperGeLower(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* If a non-literal ValueSpecification is used for lowerValue or upperValue, then evaluating that specification must not have side effects.
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateValueSpecificationNoSideEffects(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* If a non-literal ValueSpecification is used for lowerValue or upperValue, then that specification must be a constant expression.
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateValueSpecificationConstant(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* If it is not empty, then lowerValue must have an Integer value.
* lowerValue <> null implies lowerValue.integerValue() <> null
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateLowerIsInteger(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* If it is not empty, then upperValue must have an UnlimitedNatural value.
* upperValue <> null implies upperValue.unlimitedValue() <> null
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateUpperIsUnlimitedNatural(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The query isMultivalued() checks whether this multiplicity has an upper bound greater than one.
* upperBound()->notEmpty()
* result = (upperBound() > 1)
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @model kind="operation" dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false"
* @generated
*/
boolean isMultivalued();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The query includesMultiplicity() checks whether this multiplicity includes all the cardinalities allowed by the specified multiplicity.
* self.upperBound()->notEmpty() and self.lowerBound()->notEmpty() and M.upperBound()->notEmpty() and M.lowerBound()->notEmpty()
* result = ((self.lowerBound() <= M.lowerBound()) and (self.upperBound() >= M.upperBound()))
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @model dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false" MRequired="true" MOrdered="false"
* @generated
*/
boolean includesMultiplicity(MultiplicityElement M);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The query lowerBound() returns the lower bound of the multiplicity as an integer, which is the integerValue of lowerValue, if this is given, and 1 otherwise.
* result = (if (lowerValue=null or lowerValue.integerValue()=null) then 1 else lowerValue.integerValue() endif)
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @model dataType="org.eclipse.uml2.types.Integer" ordered="false"
* @generated
*/
int lowerBound();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The query upperBound() returns the upper bound of the multiplicity for a bounded multiplicity as an unlimited natural, which is the unlimitedNaturalValue of upperValue, if given, and 1, otherwise.
* result = (if (upperValue=null or upperValue.unlimitedValue()=null) then 1 else upperValue.unlimitedValue() endif)
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @model dataType="org.eclipse.uml2.types.UnlimitedNatural" required="true" ordered="false"
* @generated
*/
int upperBound();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The operation compatibleWith takes another multiplicity as input. It returns true if the other multiplicity is wider than, or the same as, self.
* result = ((other.lowerBound() <= self.lowerBound()) and ((other.upperBound() = *) or (self.upperBound() <= other.upperBound())))
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @model dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false" otherRequired="true" otherOrdered="false"
* @generated
*/
boolean compatibleWith(MultiplicityElement other);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The operation is determines if the upper and lower bound of the ranges are the ones given.
* result = (lowerbound = self.lowerBound() and upperbound = self.upperBound())
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @model dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false" lowerboundDataType="org.eclipse.uml2.types.Integer" lowerboundRequired="true" lowerboundOrdered="false" upperboundDataType="org.eclipse.uml2.types.UnlimitedNatural" upperboundRequired="true" upperboundOrdered="false"
* @generated
*/
boolean is(int lowerbound, int upperbound);
} // MultiplicityElement