Skip to content

Commit f1fd51c

Browse files
authored
Add files via upload
1 parent d856fe7 commit f1fd51c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+10034
-0
lines changed

version24/Pattern.class

11.3 KB
Binary file not shown.

version24/Pattern.java

Lines changed: 633 additions & 0 deletions
Large diffs are not rendered by default.

version24/PositionTextAction.class

1.08 KB
Binary file not shown.

version24/PossibleLoop.class

2.35 KB
Binary file not shown.

version24/PossibleLoop.java

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
import java.util.*;
2+
3+
/* Package: Statemachine */
4+
/******************************
5+
* Copyright (c) 2003,2019 Kevin Lano
6+
* This program and the accompanying materials are made available under the
7+
* terms of the Eclipse Public License 2.0 which is available at
8+
* http://www.eclipse.org/legal/epl-2.0
9+
*
10+
* SPDX-License-Identifier: EPL-2.0
11+
* *****************************/
12+
13+
14+
class PossibleLoop
15+
{ State s;
16+
Vector trs = new Vector();
17+
Vector sts = new Vector();
18+
State loophead = null;
19+
20+
PossibleLoop(State ss, Transition tr)
21+
{ // pre: tr.source == ss
22+
s = ss;
23+
trs.add(tr);
24+
}
25+
26+
public boolean isLoop()
27+
{ if (trs.size() > 0)
28+
{ Transition tr = (Transition) trs.get(trs.size()-1);
29+
return tr.target == s;
30+
}
31+
return false;
32+
}
33+
34+
public State endState()
35+
{ if (trs.size() > 0)
36+
{ Transition tr = (Transition) trs.get(trs.size()-1);
37+
return tr.target;
38+
}
39+
return s;
40+
}
41+
42+
public State getLoophead()
43+
{ return loophead; }
44+
45+
public Vector getStates()
46+
{ return sts; }
47+
48+
public boolean extend(Transition tr)
49+
{ if (trs.contains(tr))
50+
{ return false; }
51+
else
52+
{ trs.add(tr);
53+
return true;
54+
}
55+
}
56+
57+
public void calculateStates()
58+
{ sts.clear();
59+
sts.add(s);
60+
for (int i = 0; i < trs.size(); i++)
61+
{ Transition t = (Transition) trs.get(i);
62+
if (sts.contains(t.target)) { }
63+
else
64+
{ sts.add(t.target); }
65+
}
66+
}
67+
68+
public boolean checkLoop()
69+
{ loophead = null;
70+
boolean res = true;
71+
for (int i = 0; i < sts.size(); i++)
72+
{ State st = (State) sts.get(i);
73+
Vector outt = st.outgoingTransitions();
74+
Vector intt = st.incomingTransitions();
75+
for (int j = 0; j < outt.size(); j++)
76+
{ Transition tt = (Transition) outt.get(j);
77+
if (sts.contains(tt.target)) { } // add to trs?
78+
else if (loophead == null)
79+
{ loophead = st; }
80+
else if (loophead != st)
81+
{ System.out.println("Error: state " + st + " exits loop " + sts);
82+
res = false;
83+
}
84+
}
85+
for (int j = 0; j < intt.size(); j++)
86+
{ Transition tt = (Transition) intt.get(j);
87+
if (sts.contains(tt.source)) { } // add to trs?
88+
else if (loophead == null)
89+
{ loophead = st; }
90+
else if (loophead != st)
91+
{ System.out.println("Error: state " + st + " enters loop " + sts);
92+
res = false;
93+
}
94+
}
95+
}
96+
return res;
97+
}
98+
99+
public String toString()
100+
{ return s + " ==> " + trs; }
101+
}

version24/PreAssociation.class

1.53 KB
Binary file not shown.

version24/PreAssociation.java

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import java.util.Vector;
2+
3+
/******************************
4+
* Copyright (c) 2003-2023 Kevin Lano
5+
* This program and the accompanying materials are made available under the
6+
* terms of the Eclipse Public License 2.0 which is available at
7+
* http://www.eclipse.org/legal/epl-2.0
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
* *****************************/
11+
/* Package: class diagram */
12+
13+
public class PreAssociation
14+
{ String e1name;
15+
String e2name;
16+
int card1;
17+
int card2;
18+
int xs, xe;
19+
int ys, ye;
20+
String role2;
21+
String role1;
22+
Expression initialExpression;
23+
Vector stereotypes;
24+
Vector wpoints;
25+
26+
public PreAssociation()
27+
{ e1name = ""; e2name = "";
28+
role1 = ""; role2 = "";
29+
stereotypes = new Vector();
30+
card1 = ModelElement.MANY; card2 = ModelElement.MANY;
31+
}
32+
33+
public PreAssociation(String e1n, String e2n, int c1,
34+
int c2, int x1, int y1, int x2,
35+
int y2, String r2, String r1, Vector sts, Vector wps)
36+
{ e1name = e1n;
37+
e2name = e2n;
38+
card1 = c1;
39+
card2 = c2;
40+
xs = x1;
41+
ys = y1;
42+
xe = x2;
43+
ye = y2;
44+
role2 = r2;
45+
role1 = r1;
46+
stereotypes = sts;
47+
wpoints = wps;
48+
}
49+
50+
public void setInitialExpression(Expression expr)
51+
{ initialExpression = expr; }
52+
53+
public boolean isDualTo(PreAssociation pinv)
54+
{ if (pinv.role1 != null && pinv.role1.equals(role2) &&
55+
role1 != null && role1.equals(pinv.role2) &&
56+
e1name.equals(pinv.e2name) && e2name.equals(pinv.e1name))
57+
{ return true; }
58+
return false;
59+
}
60+
61+
public PreAssociation combineWith(PreAssociation pinv)
62+
{ PreAssociation res = new PreAssociation(e1name, e2name,
63+
card1, card2, xs, ys, xe, ye,
64+
role2, role1, stereotypes, wpoints);
65+
if (card1 == ModelElement.MANY)
66+
{ res.card1 = pinv.card2; }
67+
if (card2 == ModelElement.MANY)
68+
{ res.card2 = pinv.card1; }
69+
return res;
70+
}
71+
72+
}
73+

version24/PreBehaviour.class

436 Bytes
Binary file not shown.

version24/PreBehaviour.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/******************************
2+
* Copyright (c) 2003,2019 Kevin Lano
3+
* This program and the accompanying materials are made available under the
4+
* terms of the Eclipse Public License 2.0 which is available at
5+
* http://www.eclipse.org/legal/epl-2.0
6+
*
7+
* SPDX-License-Identifier: EPL-2.0
8+
* *****************************/
9+
10+
public class PreBehaviour
11+
{ String behaviouredClassifier = null;
12+
String specification = null;
13+
Statement code;
14+
15+
public PreBehaviour(String owner, String bf, Statement cde)
16+
{ behaviouredClassifier = owner;
17+
specification = bf;
18+
code = cde;
19+
}
20+
}
21+

version24/PreConstraint.class

888 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)