1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package eteg.sinon.core;
24
25 import java.util.ArrayList;
26 import java.util.List;
27
28 /***
29 * Class that represents a loop positioning step.
30 *
31 * @author <a href="mailto:thiagohp at users.sourceforge.net">Thiago H. de Paula Figueiredo</a>
32 * @author Last modified by $Author: thiagohp $
33 * @version $Revision: 1.2 $
34 */
35 public class LoopStep implements Step {
36
37 /***
38 * Loop stop condition.
39 */
40 private String condition;
41
42 /***
43 * Name of the varible whose value is used to evaluate the loop condition.
44 */
45 private String value;
46
47 /***
48 * List of data extractions that comprise this loop.
49 * They can be {@link PositioningStep}s or
50 * {@link DataExtraction}s.
51 */
52 private List steps;
53
54 /***
55 * Constructor without parameters.
56 */
57 public LoopStep() {
58
59 super();
60 condition = null;
61 steps = new ArrayList();
62
63 }
64
65 /***
66 * Returns the value of the <code>condition</code> property.
67 * @return a <code>String</code>.
68 */
69 public String getCondition() {
70 return condition;
71 }
72
73 /***
74 * Sets the value of the <code>condition</code> property.
75 * @param condition the new <code>condition</code> value.
76 */
77 public void setCondition(String condition) {
78 this.condition = condition;
79 }
80
81 /***
82 * Returns the value of the <code>value</code> property.
83 * @return a <code>String</code>.
84 */
85 public String getValue() {
86 return value;
87 }
88
89 /***
90 * Sets the value of the <code>value</code> property.
91 * @param value the new <code>value</code> value.
92 */
93 public void setValue(String value) {
94 this.value = value;
95 }
96
97 /***
98 * Adds a {@link Step} to this loop.
99 * @param step a {@link Step} instance.
100 */
101 public void addStep(Step step) {
102 steps.add(step);
103 }
104
105 /***
106 * Returns the value of the <code>steps</code> property.
107 * @return a {@link Step} array.
108 */
109 public Step[] getSteps() {
110
111 Step[] object = new Step[steps.size()];
112
113 steps.toArray(object);
114
115 return object;
116
117 }
118
119 /***
120 * Returns <code>false</code>.
121 * @return <code>false</code>.
122 */
123 public boolean isDataExtraction() {
124 return false;
125 }
126
127 /***
128 * Returns <code>false</code>.
129 * @return <code>false</code>.
130 */
131 public boolean isPositioningStep() {
132 return false;
133 }
134
135 /***
136 * Returns <code>false</code>.
137 * @return <code>false</code>.
138 */
139 public boolean isAction() {
140 return false;
141 }
142
143 /***
144 * Returns <code>true</code>.
145 * @return <code>true</code>.
146 */
147 public boolean isLoop() {
148 return true;
149 }
150
151 }