142 |
10 Aug 06 |
enell |
1 |
/* |
142 |
10 Aug 06 |
enell |
* Created on 07-Oct-2004 |
142 |
10 Aug 06 |
enell |
3 |
* |
142 |
10 Aug 06 |
enell |
* Merge.java is a part of MergeReplilcate |
142 |
10 Aug 06 |
enell |
* Copyright (C) 2004 Johan Enell, Dept Oncology, Lund University |
142 |
10 Aug 06 |
enell |
6 |
* |
142 |
10 Aug 06 |
enell |
* This program is free software; you can redistribute it and/or |
142 |
10 Aug 06 |
enell |
* modify it under the terms of the GNU General Public License |
142 |
10 Aug 06 |
enell |
* as published by the Free Software Foundation; either version 2 |
142 |
10 Aug 06 |
enell |
* of the License, or (at your option) any later version. |
142 |
10 Aug 06 |
enell |
11 |
* |
142 |
10 Aug 06 |
enell |
* This program is distributed in the hope that it will be useful, |
142 |
10 Aug 06 |
enell |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
142 |
10 Aug 06 |
enell |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
142 |
10 Aug 06 |
enell |
* GNU General Public License for more details. |
142 |
10 Aug 06 |
enell |
16 |
* |
142 |
10 Aug 06 |
enell |
* You should have received a copy of the GNU General Public License |
142 |
10 Aug 06 |
enell |
* along with this program; if not, write toX the Free Software |
142 |
10 Aug 06 |
enell |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
142 |
10 Aug 06 |
enell |
20 |
*/ |
142 |
10 Aug 06 |
enell |
21 |
package mergereplicate; |
142 |
10 Aug 06 |
enell |
22 |
|
142 |
10 Aug 06 |
enell |
23 |
import java.io.File; |
142 |
10 Aug 06 |
enell |
24 |
import java.io.FileNotFoundException; |
142 |
10 Aug 06 |
enell |
25 |
import java.io.IOException; |
142 |
10 Aug 06 |
enell |
26 |
import java.io.PrintStream; |
142 |
10 Aug 06 |
enell |
27 |
import java.util.ArrayList; |
142 |
10 Aug 06 |
enell |
28 |
import java.util.Arrays; |
142 |
10 Aug 06 |
enell |
29 |
import java.util.HashMap; |
142 |
10 Aug 06 |
enell |
30 |
import java.util.List; |
142 |
10 Aug 06 |
enell |
31 |
|
142 |
10 Aug 06 |
enell |
32 |
import basefile.BASEFileException; |
142 |
10 Aug 06 |
enell |
33 |
import basefile.BASEFileReader; |
142 |
10 Aug 06 |
enell |
34 |
import basefile.BASEFileSection; |
142 |
10 Aug 06 |
enell |
35 |
|
142 |
10 Aug 06 |
enell |
36 |
/** |
142 |
10 Aug 06 |
enell |
37 |
* |
142 |
10 Aug 06 |
enell |
* @author Johan Enell, johan.enell@onk.lu.se, Dept Oncology, Lund University, S-221 85 Lund, Sweden |
142 |
10 Aug 06 |
enell |
39 |
*/ |
142 |
10 Aug 06 |
enell |
40 |
public class MergeReplicates |
142 |
10 Aug 06 |
enell |
41 |
{ |
142 |
10 Aug 06 |
enell |
42 |
PrintStream out; |
142 |
10 Aug 06 |
enell |
43 |
|
142 |
10 Aug 06 |
enell |
44 |
/** |
142 |
10 Aug 06 |
enell |
* @param bfr |
142 |
10 Aug 06 |
enell |
* @throws IOException |
142 |
10 Aug 06 |
enell |
* @throws BadFormatException |
142 |
10 Aug 06 |
enell |
* @throws BadSectionException |
142 |
10 Aug 06 |
enell |
49 |
*/ |
142 |
10 Aug 06 |
enell |
50 |
public MergeReplicates(BASEFileReader bfr) throws Exception |
142 |
10 Aug 06 |
enell |
51 |
{ |
142 |
10 Aug 06 |
enell |
52 |
out = new PrintStream("stdout.txt"); |
142 |
10 Aug 06 |
enell |
53 |
BASEFileSection section = bfr.readSection(true); |
142 |
10 Aug 06 |
enell |
54 |
while (section != null) |
142 |
10 Aug 06 |
enell |
55 |
{ |
142 |
10 Aug 06 |
enell |
56 |
if (section.isType("settings")) |
142 |
10 Aug 06 |
enell |
57 |
{ |
142 |
10 Aug 06 |
enell |
58 |
extractSettings(section); |
142 |
10 Aug 06 |
enell |
59 |
} |
142 |
10 Aug 06 |
enell |
60 |
else if (section.isType("assays")) |
142 |
10 Aug 06 |
enell |
61 |
{ |
142 |
10 Aug 06 |
enell |
62 |
extractAssays(section, bfr); |
142 |
10 Aug 06 |
enell |
63 |
} |
142 |
10 Aug 06 |
enell |
64 |
else if (section.isType("spots")) |
142 |
10 Aug 06 |
enell |
65 |
{ |
142 |
10 Aug 06 |
enell |
66 |
extractSpots(section, bfr); |
142 |
10 Aug 06 |
enell |
67 |
} |
142 |
10 Aug 06 |
enell |
68 |
section = bfr.readSection(); |
142 |
10 Aug 06 |
enell |
69 |
} |
142 |
10 Aug 06 |
enell |
70 |
} |
142 |
10 Aug 06 |
enell |
71 |
|
142 |
10 Aug 06 |
enell |
72 |
/** |
142 |
10 Aug 06 |
enell |
* @param section |
142 |
10 Aug 06 |
enell |
* @param bfr |
142 |
10 Aug 06 |
enell |
* @throws BASEFileException |
142 |
10 Aug 06 |
enell |
* @throws IOException |
142 |
10 Aug 06 |
enell |
77 |
*/ |
142 |
10 Aug 06 |
enell |
78 |
private void extractSpots(BASEFileSection section, BASEFileReader bfr) throws BASEFileException, IOException |
142 |
10 Aug 06 |
enell |
79 |
{ |
142 |
10 Aug 06 |
enell |
80 |
List<String> assayFieldsMap; |
142 |
10 Aug 06 |
enell |
81 |
List<String> columnsMap; |
142 |
10 Aug 06 |
enell |
82 |
List<String> assaysMap; |
142 |
10 Aug 06 |
enell |
83 |
|
142 |
10 Aug 06 |
enell |
84 |
int positionPos = -1; |
142 |
10 Aug 06 |
enell |
85 |
int assayDataPos = -1; |
142 |
10 Aug 06 |
enell |
86 |
int reporterPos = -1; |
142 |
10 Aug 06 |
enell |
87 |
int ratioPos = -1; |
142 |
10 Aug 06 |
enell |
88 |
int intensityPos = -1; |
142 |
10 Aug 06 |
enell |
89 |
|
142 |
10 Aug 06 |
enell |
90 |
assaysMap = section.findFieldList("assays"); |
142 |
10 Aug 06 |
enell |
91 |
if (assaysMap == null) |
142 |
10 Aug 06 |
enell |
92 |
{ |
142 |
10 Aug 06 |
enell |
93 |
System.err.print("assaysMap row in spots section not found\n"); |
142 |
10 Aug 06 |
enell |
94 |
System.exit(0); |
142 |
10 Aug 06 |
enell |
95 |
} |
142 |
10 Aug 06 |
enell |
96 |
|
142 |
10 Aug 06 |
enell |
97 |
columnsMap = section.findFieldList("columns"); |
142 |
10 Aug 06 |
enell |
98 |
if (columnsMap == null) |
142 |
10 Aug 06 |
enell |
99 |
{ |
142 |
10 Aug 06 |
enell |
100 |
throw new BASEFileException("Columns row in spots section not found\n"); |
142 |
10 Aug 06 |
enell |
101 |
} |
142 |
10 Aug 06 |
enell |
102 |
|
142 |
10 Aug 06 |
enell |
103 |
assayFieldsMap = section.findFieldList("assayFields"); |
142 |
10 Aug 06 |
enell |
104 |
if (assayFieldsMap == null) |
142 |
10 Aug 06 |
enell |
105 |
{ |
142 |
10 Aug 06 |
enell |
106 |
throw new BASEFileException("assayFields row in spots section not found\n"); |
142 |
10 Aug 06 |
enell |
107 |
} |
142 |
10 Aug 06 |
enell |
108 |
|
142 |
10 Aug 06 |
enell |
109 |
positionPos = columnsMap.indexOf("position"); |
142 |
10 Aug 06 |
enell |
110 |
if (positionPos == -1) |
142 |
10 Aug 06 |
enell |
111 |
{ |
142 |
10 Aug 06 |
enell |
112 |
throw new BASEFileException("position column in columns row missing\n"); |
142 |
10 Aug 06 |
enell |
113 |
} |
142 |
10 Aug 06 |
enell |
114 |
|
142 |
10 Aug 06 |
enell |
115 |
reporterPos = columnsMap.indexOf("reporter"); |
142 |
10 Aug 06 |
enell |
116 |
if (reporterPos == -1) |
142 |
10 Aug 06 |
enell |
117 |
{ |
142 |
10 Aug 06 |
enell |
118 |
throw new BASEFileException("reporter column in columns row missing\n"); |
142 |
10 Aug 06 |
enell |
119 |
} |
142 |
10 Aug 06 |
enell |
120 |
|
142 |
10 Aug 06 |
enell |
121 |
assayDataPos = columnsMap.indexOf("assayData"); |
142 |
10 Aug 06 |
enell |
122 |
if (assayDataPos == -1) |
142 |
10 Aug 06 |
enell |
123 |
{ |
142 |
10 Aug 06 |
enell |
124 |
throw new BASEFileException("assayData column in columns row missing\n"); |
142 |
10 Aug 06 |
enell |
125 |
} |
142 |
10 Aug 06 |
enell |
126 |
|
142 |
10 Aug 06 |
enell |
127 |
ratioPos = assayFieldsMap.indexOf("l2ratio1_2"); |
142 |
10 Aug 06 |
enell |
128 |
if (ratioPos == -1) |
142 |
10 Aug 06 |
enell |
129 |
{ |
142 |
10 Aug 06 |
enell |
130 |
throw new BASEFileException("l2ratio1_2 field in assayFields row missing\n"); |
142 |
10 Aug 06 |
enell |
131 |
} |
142 |
10 Aug 06 |
enell |
132 |
ratioPos += assayDataPos; |
142 |
10 Aug 06 |
enell |
133 |
|
142 |
10 Aug 06 |
enell |
134 |
intensityPos = assayFieldsMap.indexOf("l10intgmean1_2"); |
142 |
10 Aug 06 |
enell |
135 |
if (intensityPos == -1) |
142 |
10 Aug 06 |
enell |
136 |
{ |
142 |
10 Aug 06 |
enell |
137 |
throw new BASEFileException("l10intgmean1_2 field in assayFields row missing\n"); |
142 |
10 Aug 06 |
enell |
138 |
} |
142 |
10 Aug 06 |
enell |
139 |
intensityPos += assayDataPos; |
142 |
10 Aug 06 |
enell |
140 |
|
142 |
10 Aug 06 |
enell |
141 |
HashMap<Integer, List<MergeReplicates.Spot>> reporters = new HashMap<Integer, List<MergeReplicates.Spot>>(); |
142 |
10 Aug 06 |
enell |
142 |
String[] row = bfr.readDataRow(); |
142 |
10 Aug 06 |
enell |
143 |
|
142 |
10 Aug 06 |
enell |
144 |
while (row != null) |
142 |
10 Aug 06 |
enell |
145 |
{ |
142 |
10 Aug 06 |
enell |
146 |
float m; |
142 |
10 Aug 06 |
enell |
147 |
float a; |
142 |
10 Aug 06 |
enell |
148 |
int pos = Integer.parseInt(row[positionPos]); |
142 |
10 Aug 06 |
enell |
149 |
int reporter = Integer.parseInt(row[reporterPos]); |
142 |
10 Aug 06 |
enell |
150 |
Spot s = new Spot(pos, reporter, assaysMap.size()); |
142 |
10 Aug 06 |
enell |
151 |
|
142 |
10 Aug 06 |
enell |
152 |
for (int i = 0; i < assaysMap.size(); i++) |
142 |
10 Aug 06 |
enell |
153 |
{ |
142 |
10 Aug 06 |
enell |
154 |
try |
142 |
10 Aug 06 |
enell |
155 |
{ |
142 |
10 Aug 06 |
enell |
156 |
m = Float.parseFloat(row[ratioPos + i * assayFieldsMap.size()]); |
142 |
10 Aug 06 |
enell |
157 |
a = Float.parseFloat(row[intensityPos + i * assayFieldsMap.size()]); |
142 |
10 Aug 06 |
enell |
158 |
} |
142 |
10 Aug 06 |
enell |
159 |
catch (NumberFormatException e) |
142 |
10 Aug 06 |
enell |
160 |
{ |
142 |
10 Aug 06 |
enell |
161 |
m = Float.NaN; |
142 |
10 Aug 06 |
enell |
162 |
a = Float.NaN; |
142 |
10 Aug 06 |
enell |
163 |
} |
142 |
10 Aug 06 |
enell |
164 |
|
142 |
10 Aug 06 |
enell |
165 |
s.setA(a, i); |
142 |
10 Aug 06 |
enell |
166 |
s.setM(m, i); |
142 |
10 Aug 06 |
enell |
167 |
} |
142 |
10 Aug 06 |
enell |
168 |
|
142 |
10 Aug 06 |
enell |
169 |
if (reporters.containsKey(reporter)) |
142 |
10 Aug 06 |
enell |
170 |
{ |
142 |
10 Aug 06 |
enell |
171 |
List<MergeReplicates.Spot> spots = reporters.get(reporter); |
142 |
10 Aug 06 |
enell |
172 |
spots.add(s); |
142 |
10 Aug 06 |
enell |
173 |
} |
142 |
10 Aug 06 |
enell |
174 |
else |
142 |
10 Aug 06 |
enell |
175 |
{ |
142 |
10 Aug 06 |
enell |
176 |
List<MergeReplicates.Spot> spots = new ArrayList<MergeReplicates.Spot>(); |
142 |
10 Aug 06 |
enell |
177 |
spots.add(s); |
142 |
10 Aug 06 |
enell |
178 |
reporters.put(reporter, spots); |
142 |
10 Aug 06 |
enell |
179 |
} |
142 |
10 Aug 06 |
enell |
180 |
row = bfr.readDataRow(); |
142 |
10 Aug 06 |
enell |
181 |
} |
142 |
10 Aug 06 |
enell |
182 |
|
142 |
10 Aug 06 |
enell |
183 |
for (String assay : assaysMap) |
142 |
10 Aug 06 |
enell |
184 |
{ |
142 |
10 Aug 06 |
enell |
185 |
out.println("section\tspots"); |
142 |
10 Aug 06 |
enell |
186 |
out.println("columns\tposition\treporter\tassayData"); |
142 |
10 Aug 06 |
enell |
187 |
out.println("setExtraFloats\tonk_nbrOfReplicates"); |
142 |
10 Aug 06 |
enell |
188 |
out.println("assayFields\tl2ratio1_2\tl10intgmean1_2\tonk_nbrOfReplicates"); |
142 |
10 Aug 06 |
enell |
189 |
out.println("assays\t" + assay); |
142 |
10 Aug 06 |
enell |
190 |
out.println("%"); |
142 |
10 Aug 06 |
enell |
191 |
|
142 |
10 Aug 06 |
enell |
192 |
for (int reporter : reporters.keySet()) |
142 |
10 Aug 06 |
enell |
193 |
{ |
142 |
10 Aug 06 |
enell |
194 |
List<MergeReplicates.Spot> replicates = reporters.get(reporter); |
142 |
10 Aug 06 |
enell |
195 |
int assayNbr = assaysMap.indexOf(assay); |
142 |
10 Aug 06 |
enell |
196 |
int nbrOfReplicates = weight(replicates, assayNbr); |
142 |
10 Aug 06 |
enell |
197 |
|
142 |
10 Aug 06 |
enell |
198 |
if (nbrOfReplicates == 0) |
142 |
10 Aug 06 |
enell |
199 |
{ |
142 |
10 Aug 06 |
enell |
200 |
continue; |
142 |
10 Aug 06 |
enell |
201 |
} |
142 |
10 Aug 06 |
enell |
202 |
|
142 |
10 Aug 06 |
enell |
203 |
for (Spot s : replicates) |
142 |
10 Aug 06 |
enell |
204 |
{ |
142 |
10 Aug 06 |
enell |
205 |
out.println(s.getPos() + "\t" + reporter + "\t" + s.getM(assayNbr) + "\t" + s.getA(assayNbr) + "\t" + nbrOfReplicates); |
142 |
10 Aug 06 |
enell |
206 |
} |
142 |
10 Aug 06 |
enell |
207 |
} |
142 |
10 Aug 06 |
enell |
208 |
out.println(); |
142 |
10 Aug 06 |
enell |
209 |
} |
142 |
10 Aug 06 |
enell |
210 |
} |
142 |
10 Aug 06 |
enell |
211 |
|
142 |
10 Aug 06 |
enell |
212 |
/** |
142 |
10 Aug 06 |
enell |
* @param list |
142 |
10 Aug 06 |
enell |
214 |
*/ |
142 |
10 Aug 06 |
enell |
215 |
private int weight(List<MergeReplicates.Spot> list, int index) |
142 |
10 Aug 06 |
enell |
216 |
{ |
142 |
10 Aug 06 |
enell |
217 |
int nbrOfReplicates = list.size(); |
142 |
10 Aug 06 |
enell |
218 |
|
142 |
10 Aug 06 |
enell |
219 |
float avgM = 0; |
142 |
10 Aug 06 |
enell |
220 |
float avgA = 0; |
142 |
10 Aug 06 |
enell |
221 |
for (Spot s : list) |
142 |
10 Aug 06 |
enell |
222 |
{ |
142 |
10 Aug 06 |
enell |
223 |
if (!Float.isNaN(s.getA(index)) && !Float.isNaN(s.getM(index))) |
142 |
10 Aug 06 |
enell |
224 |
{ |
142 |
10 Aug 06 |
enell |
225 |
avgM += s.getM(index); |
142 |
10 Aug 06 |
enell |
226 |
avgA += s.getA(index); |
142 |
10 Aug 06 |
enell |
227 |
} |
142 |
10 Aug 06 |
enell |
228 |
else |
142 |
10 Aug 06 |
enell |
229 |
{ |
142 |
10 Aug 06 |
enell |
230 |
nbrOfReplicates--; |
142 |
10 Aug 06 |
enell |
231 |
} |
142 |
10 Aug 06 |
enell |
232 |
} |
142 |
10 Aug 06 |
enell |
233 |
avgM = avgM / nbrOfReplicates; |
142 |
10 Aug 06 |
enell |
234 |
avgA = avgA / nbrOfReplicates; |
142 |
10 Aug 06 |
enell |
235 |
|
142 |
10 Aug 06 |
enell |
236 |
for (Spot s : list) |
142 |
10 Aug 06 |
enell |
237 |
{ |
142 |
10 Aug 06 |
enell |
238 |
s.setA(avgA, index); |
142 |
10 Aug 06 |
enell |
239 |
s.setM(avgM, index); |
142 |
10 Aug 06 |
enell |
240 |
} |
142 |
10 Aug 06 |
enell |
241 |
return nbrOfReplicates; |
142 |
10 Aug 06 |
enell |
242 |
} |
142 |
10 Aug 06 |
enell |
243 |
|
142 |
10 Aug 06 |
enell |
244 |
/** |
142 |
10 Aug 06 |
enell |
* @param section |
142 |
10 Aug 06 |
enell |
* @param bfr |
142 |
10 Aug 06 |
enell |
247 |
*/ |
142 |
10 Aug 06 |
enell |
248 |
private void extractAssays(BASEFileSection section, BASEFileReader bfr) |
142 |
10 Aug 06 |
enell |
249 |
{ |
142 |
10 Aug 06 |
enell |
250 |
out.println("BASEfile"); |
142 |
10 Aug 06 |
enell |
251 |
} |
142 |
10 Aug 06 |
enell |
252 |
|
142 |
10 Aug 06 |
enell |
253 |
/** |
142 |
10 Aug 06 |
enell |
* @param section |
142 |
10 Aug 06 |
enell |
255 |
*/ |
142 |
10 Aug 06 |
enell |
256 |
private void extractSettings(BASEFileSection section) |
142 |
10 Aug 06 |
enell |
257 |
{} |
142 |
10 Aug 06 |
enell |
258 |
|
142 |
10 Aug 06 |
enell |
259 |
public static void main(String[] args) throws Throwable |
142 |
10 Aug 06 |
enell |
260 |
{ |
142 |
10 Aug 06 |
enell |
261 |
try |
142 |
10 Aug 06 |
enell |
262 |
{ |
142 |
10 Aug 06 |
enell |
263 |
BASEFileReader bfr = null; |
142 |
10 Aug 06 |
enell |
264 |
if (args.length == 1) |
142 |
10 Aug 06 |
enell |
265 |
{ |
142 |
10 Aug 06 |
enell |
266 |
bfr = new BASEFileReader(new File(args[0])); |
142 |
10 Aug 06 |
enell |
267 |
} |
142 |
10 Aug 06 |
enell |
268 |
else if (args.length == 0) |
142 |
10 Aug 06 |
enell |
269 |
{ |
142 |
10 Aug 06 |
enell |
270 |
bfr = new BASEFileReader(new File("stdin.txt")); |
142 |
10 Aug 06 |
enell |
271 |
} |
142 |
10 Aug 06 |
enell |
272 |
else |
142 |
10 Aug 06 |
enell |
273 |
{ |
142 |
10 Aug 06 |
enell |
274 |
throw new Exception("Merge Replicate: invalid input given"); |
142 |
10 Aug 06 |
enell |
275 |
} |
142 |
10 Aug 06 |
enell |
276 |
new MergeReplicates(bfr); |
142 |
10 Aug 06 |
enell |
277 |
} |
142 |
10 Aug 06 |
enell |
278 |
catch (OutOfMemoryError e) |
142 |
10 Aug 06 |
enell |
279 |
{ |
142 |
10 Aug 06 |
enell |
280 |
throw new Exception("No more memory in the java virtual machine. Try to start the application with the flag '-Xmx256m' or '-Xmx512m'. If you need even more memory choose a larger digit (max 1024)", e); |
142 |
10 Aug 06 |
enell |
281 |
|
142 |
10 Aug 06 |
enell |
282 |
} |
142 |
10 Aug 06 |
enell |
283 |
catch (FileNotFoundException e) |
142 |
10 Aug 06 |
enell |
284 |
{ |
142 |
10 Aug 06 |
enell |
285 |
throw new Exception("Could not find the file " + args[0], e); |
142 |
10 Aug 06 |
enell |
286 |
} |
142 |
10 Aug 06 |
enell |
287 |
catch (Throwable t) |
142 |
10 Aug 06 |
enell |
288 |
{ |
142 |
10 Aug 06 |
enell |
289 |
throw t; |
142 |
10 Aug 06 |
enell |
290 |
} |
142 |
10 Aug 06 |
enell |
291 |
} |
142 |
10 Aug 06 |
enell |
292 |
|
142 |
10 Aug 06 |
enell |
293 |
private class Spot |
142 |
10 Aug 06 |
enell |
294 |
{ |
142 |
10 Aug 06 |
enell |
295 |
private int reporter; |
142 |
10 Aug 06 |
enell |
296 |
|
142 |
10 Aug 06 |
enell |
297 |
private int pos; |
142 |
10 Aug 06 |
enell |
298 |
|
142 |
10 Aug 06 |
enell |
299 |
private float[] m; |
142 |
10 Aug 06 |
enell |
300 |
|
142 |
10 Aug 06 |
enell |
301 |
private float[] a; |
142 |
10 Aug 06 |
enell |
302 |
|
142 |
10 Aug 06 |
enell |
303 |
public Spot(int pos, int reporter, int size) |
142 |
10 Aug 06 |
enell |
304 |
{ |
142 |
10 Aug 06 |
enell |
305 |
this.pos = pos; |
142 |
10 Aug 06 |
enell |
306 |
this.reporter = reporter; |
142 |
10 Aug 06 |
enell |
307 |
|
142 |
10 Aug 06 |
enell |
308 |
m = new float[size]; |
142 |
10 Aug 06 |
enell |
309 |
a = new float[size]; |
142 |
10 Aug 06 |
enell |
310 |
} |
142 |
10 Aug 06 |
enell |
311 |
|
142 |
10 Aug 06 |
enell |
312 |
public float getM(int index) |
142 |
10 Aug 06 |
enell |
313 |
{ |
142 |
10 Aug 06 |
enell |
314 |
return m[index]; |
142 |
10 Aug 06 |
enell |
315 |
} |
142 |
10 Aug 06 |
enell |
316 |
|
142 |
10 Aug 06 |
enell |
317 |
public float getA(int index) |
142 |
10 Aug 06 |
enell |
318 |
{ |
142 |
10 Aug 06 |
enell |
319 |
return a[index]; |
142 |
10 Aug 06 |
enell |
320 |
} |
142 |
10 Aug 06 |
enell |
321 |
|
142 |
10 Aug 06 |
enell |
322 |
public int getPos() |
142 |
10 Aug 06 |
enell |
323 |
{ |
142 |
10 Aug 06 |
enell |
324 |
return pos; |
142 |
10 Aug 06 |
enell |
325 |
} |
142 |
10 Aug 06 |
enell |
326 |
|
142 |
10 Aug 06 |
enell |
327 |
public void setM(float m, int index) |
142 |
10 Aug 06 |
enell |
328 |
{ |
142 |
10 Aug 06 |
enell |
329 |
this.m[index] = m; |
142 |
10 Aug 06 |
enell |
330 |
} |
142 |
10 Aug 06 |
enell |
331 |
|
142 |
10 Aug 06 |
enell |
332 |
public void setA(float a, int index) |
142 |
10 Aug 06 |
enell |
333 |
{ |
142 |
10 Aug 06 |
enell |
334 |
this.a[index] = a; |
142 |
10 Aug 06 |
enell |
335 |
} |
142 |
10 Aug 06 |
enell |
336 |
|
142 |
10 Aug 06 |
enell |
337 |
public int getReporter() |
142 |
10 Aug 06 |
enell |
338 |
{ |
142 |
10 Aug 06 |
enell |
339 |
return reporter; |
142 |
10 Aug 06 |
enell |
340 |
} |
142 |
10 Aug 06 |
enell |
341 |
|
142 |
10 Aug 06 |
enell |
342 |
@Override |
142 |
10 Aug 06 |
enell |
343 |
public String toString() |
142 |
10 Aug 06 |
enell |
344 |
{ |
142 |
10 Aug 06 |
enell |
345 |
return "[" + pos + "," + reporter + "," + Arrays.toString(m) + "," + Arrays.toString(a) + "]"; |
142 |
10 Aug 06 |
enell |
346 |
} |
142 |
10 Aug 06 |
enell |
347 |
} |
142 |
10 Aug 06 |
enell |
348 |
} |