Package: LazyTestSequence$1

LazyTestSequence$1

nameinstructionbranchcomplexitylinemethod
hasNext()
M: 10 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
next()
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
remove()
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
{...}
M: 9 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package org.overture.codegen.runtime.traces;
2:
3: import java.util.Iterator;
4:
5: public class LazyTestSequence extends TestSequence
6: {
7:         private static final long serialVersionUID = -8449551289160946386L;
8:
9:         private IIterableTraceNode node;
10:
11:         public LazyTestSequence(IIterableTraceNode node)
12:         {
13:                 this.node = node;
14:         }
15:
16:         @Override
17:         public synchronized int size()
18:         {
19:                 return this.node.size();
20:         }
21:
22:         @Override
23:         public synchronized boolean isEmpty()
24:         {
25:                 return !iterator().hasNext();
26:         }
27:
28:         @Override
29:         public synchronized CallSequence get(int index)
30:         {
31:                 return this.node.get(index);
32:         }
33:
34:         @Override
35:         public synchronized Iterator<CallSequence> iterator()
36:         {
37:                 return new Iterator<CallSequence>()
38:                 {
39:                         int index = 0;
40:
41:                         @Override
42:                         public boolean hasNext()
43:                         {
44:•                                return index < LazyTestSequence.this.size();
45:                         }
46:
47:                         @Override
48:                         public CallSequence next()
49:                         {
50:                                 CallSequence test = LazyTestSequence.this.get(index++);
51:
52:                                 markFiltered(test);
53:
54:                                 return test;
55:                         }
56:
57:                         @Override
58:                         public void remove()
59:                         {
60:                                 // Not supported
61:                         }
62:                 };
63:         }
64: }