Revize 55515be9
Přidáno uživatelem Michal Linha před téměř 4 roky(ů)
src/main/java/vldc/aswi/utils/Converter.java | ||
---|---|---|
38 | 38 |
public List<ContingencyTableRow> convertTableColumnsToContingencyTableRows() { |
39 | 39 |
long startTime = System.nanoTime(); |
40 | 40 |
|
41 |
long startTime1 = System.nanoTime(); |
|
41 | 42 |
columnNodes = new ArrayList<>(); |
42 | 43 |
List<List<String>> values = new ArrayList<>(); |
43 | 44 |
for(NameUserName nameUserName : columnNames) { |
... | ... | |
48 | 49 |
Node startNode = new Node(); |
49 | 50 |
generateColumns(0, values, columnNodes, startNode); |
50 | 51 |
|
52 |
long stopTime1 = System.nanoTime(); |
|
53 |
System.out.println("Colums list:" + TimeUnit.MILLISECONDS.convert((stopTime1 - startTime1), TimeUnit.NANOSECONDS)); |
|
54 |
|
|
51 | 55 |
List<ContingencyTableRow> contingencyTableRows = new ArrayList<>(); |
52 | 56 |
|
53 | 57 |
long startTime2 = System.nanoTime(); |
... | ... | |
87 | 91 |
* @return list of contingency table rows |
88 | 92 |
*/ |
89 | 93 |
private List<ContingencyTableRow> createHeaderOnlyRows() { |
90 |
//columnNodes = new ArrayList<>(); |
|
91 | 94 |
List<ContingencyTableRow> headerRows = new ArrayList<>(); |
92 | 95 |
|
93 |
// List<String> valueOptions = new ArrayList<>(); |
|
94 |
// |
|
95 |
// for (ValueFunction valueFunction : valueFunctions) { |
|
96 |
// if (!valueFunctions.get(0).getType().equals("Seznam")) { |
|
97 |
// valueOptions.add(valueFunction.getFunction() + " z " + valueFunction.getName()); |
|
98 |
// } |
|
99 |
// else if (valueFunctions.get(0).getType().equals("Seznam") && columnNames.size() > 0) { |
|
100 |
// valueOptions.add("NIC z nic"); |
|
101 |
// } |
|
102 |
// } |
|
103 |
|
|
104 |
//values.add(valueOptions); |
|
105 | 96 |
headerRows.add(new ContingencyTableRow(true, 0)); |
106 | 97 |
|
107 | 98 |
for (int i = 0; i < columnNames.size(); i++) { |
108 |
//NameUserName ignored = columnNames.get(i); |
|
109 |
//TableColumn column = tableColumns.get(nameUserName.getName()); |
|
110 | 99 |
headerRows.add(new ContingencyTableRow(true, 0)); |
111 | 100 |
} |
112 | 101 |
|
113 |
if (valueFunctions.get(0).getType().equals("Seznam")) { |
|
102 |
if (valueFunctions.get(0).getFunction() != null && valueFunctions.get(0).getFunction().equals("NIC") && |
|
103 |
columnNames.size() == 0) { |
|
114 | 104 |
headerRows.get(0).addTableRowCell(new ContingencyTableRowCell("Seznam", 1)); |
105 |
|
|
115 | 106 |
return headerRows; |
116 | 107 |
} |
117 | 108 |
|
... | ... | |
154 | 145 |
} |
155 | 146 |
|
156 | 147 |
prevSize = columnNode.getValues().size(); |
157 |
prevValues.remove(prevValues.size() - 1); |
|
148 |
|
|
149 |
if (!prevValues.isEmpty()) { |
|
150 |
prevValues.remove(prevValues.size() - 1); |
|
151 |
} |
|
158 | 152 |
} |
159 | 153 |
} |
160 | 154 |
|
... | ... | |
166 | 160 |
" z " + valueFunction.getName(), 1)); |
167 | 161 |
} |
168 | 162 |
|
169 |
|
|
170 |
|
|
171 |
long startTime = System.nanoTime(); |
|
172 |
long stopTime = System.nanoTime(); |
|
173 |
System.out.println("Colums list:" + TimeUnit.MILLISECONDS.convert((stopTime - startTime), TimeUnit.NANOSECONDS)); |
|
174 |
|
|
175 | 163 |
return headerRows; |
176 | 164 |
} |
177 | 165 |
|
... | ... | |
220 | 208 |
|
221 | 209 |
dataRows.removeAll(rowsToBeRemoved); |
222 | 210 |
|
223 |
if (!valueFunctions.get(0).getType().equals("Seznam") ||
|
|
224 |
(valueFunctions.get(0).getType().equals("Seznam") && columnNames.size() > 0)) {
|
|
211 |
if (valueFunctions.get(0).getFunction() != null && (!valueFunctions.get(0).getFunction().equals("NIC") ||
|
|
212 |
(valueFunctions.get(0).getFunction().equals("NIC") && columnNames.size() > 0))) {
|
|
225 | 213 |
dataRows.add(createFinalRow()); |
226 | 214 |
} |
227 | 215 |
|
... | ... | |
303 | 291 |
|
304 | 292 |
List<Integer> usableIDs = getUsableIDs(node); |
305 | 293 |
|
306 |
if (valueFunctions.get(0).getType().equals("Seznam") && !usableIDs.isEmpty()) { |
|
294 |
if (valueFunctions.get(0).getFunction() != null && valueFunctions.get(0).getFunction().equals("NIC") && |
|
295 |
!usableIDs.isEmpty()) { |
|
307 | 296 |
return true; |
308 | 297 |
} |
309 | 298 |
|
... | ... | |
314 | 303 |
initializeWrapperField(totalsAvgSum); |
315 | 304 |
|
316 | 305 |
boolean[] isFilledValueCells = new boolean[valueFunctions.size()]; |
317 |
int columnIndex = 0; |
|
318 | 306 |
//hodnota |
319 | 307 |
for (int v = 0; v < valueFunctions.size(); v++) { |
308 |
if (valueFunctions.get(v).getFunction() != null && (valueFunctions.get(v).getFunction().equals("") || |
|
309 |
valueFunctions.get(v).getFunction().equals("NIC"))) { |
|
310 |
isRowUsable = true; |
|
311 |
break; |
|
312 |
} |
|
320 | 313 |
BooleanWrapper isFirstMinMaxTotal = new BooleanWrapper(true); |
321 | 314 |
ValueFunction valueFunction = valueFunctions.get(v); |
322 | 315 |
//sloupec v kont. tabulce |
... | ... | |
364 | 357 |
row.addTableRowCell(generateFilledCell(valueFunction.getFunction(), result.getValue(), result.getValue(), result.getValue(), |
365 | 358 |
result.getValue(), resultAvgSum.getValue(), result.getValue())); |
366 | 359 |
} |
367 |
columnIndex++; |
|
368 | 360 |
} |
369 | 361 |
} |
370 | 362 |
for (int i = 0; i < valueFunctions.size(); i++) { |
371 |
if (valueFunctions.get(i).getType().equals("Seznam")) {
|
|
363 |
if (valueFunctions.get(i).getFunction() != null && valueFunctions.get(i).getFunction().equals("NIC")) {
|
|
372 | 364 |
break; |
373 | 365 |
} |
374 | 366 |
if (!isFilledValueCells[i]) { |
... | ... | |
583 | 575 |
ContingencyTableRow finalRow = new ContingencyTableRow(false, 0); |
584 | 576 |
finalRow.addTableRowCell(new ContingencyTableRowCell("Celkem", 1)); |
585 | 577 |
|
578 |
if (valueFunctions.get(0).getFunction() != null && valueFunctions.get(0).getFunction().equals("NIC")) { |
|
579 |
return finalRow; |
|
580 |
} |
|
581 |
|
|
586 | 582 |
List<ContingencyTableRowCell> valueCells = new ArrayList<>(); |
587 | 583 |
for (ValueFunction valueFunction : valueFunctions) { |
588 | 584 |
for (Node columnNode : columnNodes) { |
Také k dispozici: Unified diff
re #8113 re #7885 bug fixes, list generation re #8134 changed row indentations in previous commit; re #8154 nothing; no comments