Revision 104,
965 bytes
checked in by wojtekp, 13 years ago
(diff) |
|
-
Property svn:mime-type set to
text/plain
|
Line | |
---|
1 | package simulator.lists; |
---|
2 | |
---|
3 | import gssim.schedframe.scheduling.AbstractExecutable; |
---|
4 | |
---|
5 | import java.util.ArrayList; |
---|
6 | import java.util.List; |
---|
7 | |
---|
8 | /** |
---|
9 | * |
---|
10 | * @author Marcin Krystek |
---|
11 | * |
---|
12 | */ |
---|
13 | public class ExecutablesList extends ArrayList<AbstractExecutable> { |
---|
14 | |
---|
15 | private static final long serialVersionUID = 2864146884080359884L; |
---|
16 | |
---|
17 | |
---|
18 | public List<AbstractExecutable> getJobExecutables(String jobId){ |
---|
19 | List<AbstractExecutable> list = new ArrayList<AbstractExecutable>(); |
---|
20 | |
---|
21 | for(int i = 0; i < size(); i++){ |
---|
22 | AbstractExecutable exec = get(i); |
---|
23 | |
---|
24 | if(exec.getJobId().equals(jobId)) |
---|
25 | list.add(exec); |
---|
26 | } |
---|
27 | |
---|
28 | return list; |
---|
29 | } |
---|
30 | |
---|
31 | public List<AbstractExecutable> getTaskExecutables(String jobId, String taskId){ |
---|
32 | List<AbstractExecutable> list = new ArrayList<AbstractExecutable>(); |
---|
33 | |
---|
34 | for(int i = 0; i < size(); i++){ |
---|
35 | AbstractExecutable exec = get(i); |
---|
36 | |
---|
37 | if(exec.getJobId().equals(jobId) && exec.getId().equals(taskId)) |
---|
38 | list.add(exec); |
---|
39 | } |
---|
40 | |
---|
41 | return list; |
---|
42 | } |
---|
43 | |
---|
44 | |
---|
45 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.