-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSysMLSignal.java
More file actions
114 lines (107 loc) · 3.62 KB
/
Copy pathSysMLSignal.java
File metadata and controls
114 lines (107 loc) · 3.62 KB
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
package sysmlinjava.common;
import sysmlinjava.analysis.common.StackedProtocolObject;
/**
* SysMLinJava's represention of the SysML signal. {@code SysMLSignal} is
* abstract and must be the base class for all signal types used for
* communicating energy, matter, or information between {@code SysMLFullPort}s.
* The {@code SysMLSignal} also implements the {@code StackedProtocolObject}
* interface which provides services for protocol objects in a protocol stack.
*
* @author ModelerOne
*
*/
public abstract class SysMLSignal extends SysMLClass implements StackedProtocolObject
{
/**
* Constructor
*/
public SysMLSignal()
{
super();
}
/**
* Constructor for signal name
*
* @param name name of the signal
* @param id unique ID for the signal
*/
public SysMLSignal(String name, long id)
{
super(name, id);
}
/**
* Overridable operation that initializes the signal's requirements, if any. An example
* follows:
*
* <pre>
* @Requirement
* public SysMLRequirement myFirstRequirement;
*
* @Requirement
* public SysMLRequirement myNextRequirement;
* </pre>
*
* <pre>
* myFirstRequirement = MySysMLRequirements.firstSysMLRequirement;
* myNextRequirement = MySysMLRequirements.nextSysMLRequirement;
* </pre>
*
* where the the target of the assignment operation is the name of a field with
* the {@code @Requirement} annotation and
* {@code MySysMLRequirements.firstSysMLRequirement} is a reference to an
* instance of a {@code SysMLRequirement} in an extension/specialization of the
* {@code SysMLRequirements} class.
* <p>
* <b>Note</b> that signal requirements should be declared as described above,
* i.e. as references to instantiations of {@code SysMLRequirement}s declared
* and initialized in classes that extend/specialize the
* {@code SysMLRequirements} class. Requirements should <b>not</b> be
* declared/initialized in the signal itself. Requirement specifications in the
* typical SysML model are collected in a model package where they can be easily
* queried and managed. The SysMLinJava approach of collecting requirements in a
* single class emulates this method.
*
* @see sysmlinjava.requirements.SysMLRequirements
*/
protected void createRequirements()
{
}
/**
* Overridable operation that creates the dependencies for this signal. Overrides
* of this operation should perform initializations of variables annotated as
* dependencies. Whereas dependencies are types of association, each dependency
* should be defined by a field annotated as follows:
*
* <pre>
* @Dependency
* public APartBlock aPartDependency;
* </pre>
*
* and initialized by an object reference For example:
*
* <pre>
* aPartDependency = ((ParentBlock)contextBlock).bPartBlock;
* </pre>
*
* where {@code aDependency} is the name of a variable that represents a
* dependency (trace, usage, etc} of this block on another model element. Note
* the assignment value should be a reference to another model element, and not
* to a "new" object (constructor).
*/
protected void createDependencies()
{
}
@Override
public String toString()
{
return String.format("SysMLSignal [name=%s, id=%s]", name, id);
}
/**
* Name of method to create requirements, used by SysMLinJava tools
*/
public static final String createRequirementsMethodName = "createRequirements";
/**
* Name of method to create dependencies, used by SysMLinJava tools
*/
public static final String createDependenciesMethodName = "createDependencies";
}