/
OperationOwner.java
133 lines (125 loc) · 4.59 KB
/
OperationOwner.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
/*
* Copyright (c) 2013, 2018 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:
* Christian W. Damus (CEA) - initial API and implementation
* Kenn Hussey (CEA) - 468230
* Kenn Hussey - 535301
*
*/
package org.eclipse.uml2.uml;
import org.eclipse.emf.common.util.EList;
/**
* Common protocol for {@linkplain Classifier classifiers} that own
* {@linkplain Classifier#getOperations() operations}.
*
* @since 5.0
*/
public interface OperationOwner {
/**
* Obtains the operations owned by this classifier.
*
* @return my owned operations
*/
EList<Operation> getOwnedOperations();
/**
* Creates a new void {@link Operation} (having no return result) as an
* owned operation of this classifier.
*
* @param name
* the name of the new operation (may be {@code null})
* @param parameterNames
* the names of the operation's {@link ParameterDirectionKind#IN
* IN} parameters (may be {@code null} if no parameters are
* needed)
* @param parameterTypes
* the types of the operation's {@link ParameterDirectionKind#IN
* IN} parameters (may be {@code null} if no parameters are
* needed)
*
* @return the new owned operation
*
* @see #createOwnedOperation(String, EList, EList, Type)
* @see #getOwnedOperation(String, EList, EList)
*/
Operation createOwnedOperation(String name, EList<String> parameterNames,
EList<Type> parameterTypes);
/**
* Creates a new {@link Operation} as an owned operation of this classifier.
*
* @param name
* the name of the new operation (may be {@code null})
* @param parameterNames
* the names of the operation's {@link ParameterDirectionKind#IN
* IN} parameters (may be {@code null} if no parameters are
* needed)
* @param parameterTypes
* the types of the operation's {@link ParameterDirectionKind#IN
* IN} parameters (may be {@code null} if no parameters are
* needed)
* @param returnType
* the type of the operation (which is the type of its sole
* {@linkplain ParameterDirectionKind#RETURN return result})
*
* @return the new owned operation
*
* @see #createOwnedOperation(String, EList, EList)
* @see #getOwnedOperation(String, EList, EList)
*/
Operation createOwnedOperation(String name, EList<String> parameterNames,
EList<Type> parameterTypes, Type returnType);
/**
* Finds the first owned operation that matches all or any of the given
* {@code name}, {@code parameterNames}, and {@code parameterTypes}.
*
* @param name
* the operation name to match, or {@code null} to match any
* operation name
* @param parameterNames
* the parameter names to match, or {@code null} to match any
* parameter names
* @param parameterTypes
* the parameter types to match, or {@code null} to match any
* signature
*
* @return any matching operation, or {@code null} if not found
*
* @see #getOwnedOperation(String, EList, EList, boolean, boolean)
*/
Operation getOwnedOperation(String name, EList<String> parameterNames,
EList<Type> parameterTypes);
/**
* Finds the first owned operation that matches all or any of the given
* {@code name} (optionally case-insensitive), {@code parameterNames}
* (optionally case-insensitive), and {@code parameterTypes}.
*
* @param name
* the operation name to match, or {@code null} to match any
* operation name
* @param parameterNames
* the parameter names to match, or {@code null} to match any
* parameter names
* @param parameterTypes
* the parameter types to match, or {@code null} to match any
* signature
* @param ignoreCase
* whether matching of operation and parameter names is
* case-insensitive
* @param createOnDemand
* whether to create the owned operation and return it if an
* existing match is not found
*
* @return any matching operation, or {@code null} if not found and
* {@code createOnDemand} is {@code false}
*
* @see #getOwnedOperation(String, EList, EList)
*/
Operation getOwnedOperation(String name, EList<String> parameterNames,
EList<Type> parameterTypes, boolean ignoreCase,
boolean createOnDemand);
}