-
Notifications
You must be signed in to change notification settings - Fork 0
/
End.java
154 lines (138 loc) · 3.78 KB
/
End.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
/*PLEASE DO NOT EDIT THIS CODE*/
/*This code was generated using the UMPLE 1.29.1.4295.41a59b8ce modeling language!*/
import java.util.*;
// line 87 "model.ump"
// line 195 "model.ump"
public class End
{
//------------------------
// MEMBER VARIABLES
//------------------------
//End Associations
private List<SysCallReader> sysCallReaders;
//------------------------
// CONSTRUCTOR
//------------------------
public End()
{
sysCallReaders = new ArrayList<SysCallReader>();
}
//------------------------
// INTERFACE
//------------------------
/* Code from template association_GetMany */
public SysCallReader getSysCallReader(int index)
{
SysCallReader aSysCallReader = sysCallReaders.get(index);
return aSysCallReader;
}
public List<SysCallReader> getSysCallReaders()
{
List<SysCallReader> newSysCallReaders = Collections.unmodifiableList(sysCallReaders);
return newSysCallReaders;
}
public int numberOfSysCallReaders()
{
int number = sysCallReaders.size();
return number;
}
public boolean hasSysCallReaders()
{
boolean has = sysCallReaders.size() > 0;
return has;
}
public int indexOfSysCallReader(SysCallReader aSysCallReader)
{
int index = sysCallReaders.indexOf(aSysCallReader);
return index;
}
/* Code from template association_MinimumNumberOfMethod */
public static int minimumNumberOfSysCallReaders()
{
return 0;
}
/* Code from template association_AddManyToManyMethod */
public boolean addSysCallReader(SysCallReader aSysCallReader)
{
boolean wasAdded = false;
if (sysCallReaders.contains(aSysCallReader)) { return false; }
sysCallReaders.add(aSysCallReader);
if (aSysCallReader.indexOfEnd(this) != -1)
{
wasAdded = true;
}
else
{
wasAdded = aSysCallReader.addEnd(this);
if (!wasAdded)
{
sysCallReaders.remove(aSysCallReader);
}
}
return wasAdded;
}
/* Code from template association_RemoveMany */
public boolean removeSysCallReader(SysCallReader aSysCallReader)
{
boolean wasRemoved = false;
if (!sysCallReaders.contains(aSysCallReader))
{
return wasRemoved;
}
int oldIndex = sysCallReaders.indexOf(aSysCallReader);
sysCallReaders.remove(oldIndex);
if (aSysCallReader.indexOfEnd(this) == -1)
{
wasRemoved = true;
}
else
{
wasRemoved = aSysCallReader.removeEnd(this);
if (!wasRemoved)
{
sysCallReaders.add(oldIndex,aSysCallReader);
}
}
return wasRemoved;
}
/* Code from template association_AddIndexControlFunctions */
public boolean addSysCallReaderAt(SysCallReader aSysCallReader, int index)
{
boolean wasAdded = false;
if(addSysCallReader(aSysCallReader))
{
if(index < 0 ) { index = 0; }
if(index > numberOfSysCallReaders()) { index = numberOfSysCallReaders() - 1; }
sysCallReaders.remove(aSysCallReader);
sysCallReaders.add(index, aSysCallReader);
wasAdded = true;
}
return wasAdded;
}
public boolean addOrMoveSysCallReaderAt(SysCallReader aSysCallReader, int index)
{
boolean wasAdded = false;
if(sysCallReaders.contains(aSysCallReader))
{
if(index < 0 ) { index = 0; }
if(index > numberOfSysCallReaders()) { index = numberOfSysCallReaders() - 1; }
sysCallReaders.remove(aSysCallReader);
sysCallReaders.add(index, aSysCallReader);
wasAdded = true;
}
else
{
wasAdded = addSysCallReaderAt(aSysCallReader, index);
}
return wasAdded;
}
public void delete()
{
ArrayList<SysCallReader> copyOfSysCallReaders = new ArrayList<SysCallReader>(sysCallReaders);
sysCallReaders.clear();
for(SysCallReader aSysCallReader : copyOfSysCallReaders)
{
aSysCallReader.removeEnd(this);
}
}
}