summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-analytics/src/main/java
diff options
context:
space:
mode:
authorLorraine Welch <lb2391@att.com>2020-05-24 13:53:43 +0000
committerGerrit Code Review <gerrit@onap.org>2020-05-24 13:53:43 +0000
commit455d4211130b1ac46b4954b03454b54e65c80bb8 (patch)
tree06c821ae9bcd1c67ed2f86a4dbdde46f3087e409 /ecomp-sdk/epsdk-analytics/src/main/java
parente67bffe06d008763083ab6445d5204157f8555e2 (diff)
parent530e1e32ad7464ec002baf3804d37aa8dbc6478b (diff)
Merge "lowered some code smells in a few components"
Diffstat (limited to 'ecomp-sdk/epsdk-analytics/src/main/java')
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ReportData.java45
1 files changed, 1 insertions, 44 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ReportData.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ReportData.java
index fd87f4cb..a0c35e0c 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ReportData.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/view/ReportData.java
@@ -157,11 +157,6 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
r++;
} // for
-/* for (reportDataRows.resetNext(); reportDataRows.hasNext();) {
- DataRow dr = reportDataRows.getNext();
- dr.addDataValue(colIdx, new DataValue());
- } // for
- */
for(int j = 0; j < dataList.size(); j++) {
DataRow dr = (DataRow) dataList.get(j);
dr.addDataValue(colIdx, new DataValue());
@@ -183,11 +178,9 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
try {
boolean nameFound = false;
- // String prevColName = null;
Vector prevColNames = new Vector();
int columnSort = -1;
for (int r = 0; r < colNameValues.size(); r++) {
- //String colName = (String) colNameValues.get(r);
String colName = ((DataValue) colNameValues.get(r)).getDisplayValue();
Integer colSortName = null;
if(colNameSortValues!=null)
@@ -266,9 +259,6 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
for (c = 0; c < getDataColumnCount(); c++) {
dr.addDataValue(new DataValue());
}
-
- //reportDataRows.addDataRow(rowIdx, dr);
- //dr.setRowNum(dataList.size()==0?1:dataList.size());
dataList.add(rowIdx, dr);
} // insertRow
@@ -288,7 +278,6 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
boolean nameFound = false;
Vector prevRowNames = new Vector();
for (int c = 0; c < rowNameValues.size(); c++) {
- //String rowName = (String) rowNameValues.get(c);
String rowName = ((DataValue) rowNameValues.get(c)).getDisplayValue();
RowHeaderCol rhc = reportRowHeaderCols.getRowHeaderCol(c);
@@ -341,7 +330,6 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
int colIdx = findColumnIdx(colNameValues, colNameSortValues, crossTabOrderManager, true, dataList);
if ((rowIdx >= 0) && (colIdx >= 0)) {
- //DataRow dr = reportDataRows.getDataRow(rowIdx);
DataRow dr = (DataRow)dataList.get(rowIdx);
dr.setRowValues(rowNameValues);
dr.setDataValue(colIdx, value);
@@ -435,11 +423,9 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
public void addRowNumbers(int pageNo, List dataList) {
pageNo = 0;
- //int startRowNum = ((pageNo < 0) ? 0 : pageNo) * pageSize + 1;
int startRowNum = 0;
RowHeaderCol rhc = new RowHeaderCol();
reportRowHeaderCols.addRowHeaderCol(0, rhc);
- //rhc.setColumnWidth("5%");
for (int r = 0; r < dataList.size(); r++) {
rhc.add(new RowHeader(startRowNum + r+""));
((DataRow)dataList.get(r)).setRowNum(r);
@@ -477,17 +463,13 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
reportColumnHeaderRows.addColumnHeaderRow(chr);
chr.setRowHeight("30");
} // if
- /*ColumnHeader ch = new ColumnHeader(displayName, (displayWidth > 100) ? "10%" : (""
- + displayWidth + "%"), alignment, 1, isRuntimeColSortDisabled ? null : colId);
- */
+
ColumnHeader ch = new ColumnHeader(displayName, displayWidthInPxls, alignment, 1, isRuntimeColSortDisabled ? null : colId);
ch.setGroupLevel(level);
ch.setStartGroup(start);
ch.setColSpanGroup(colspan);
ch.setColId(colId);
ch.setSortable(sortable);
- //chr.addColumnHeader(new ColumnHeader(displayName, (displayWidth > 100) ? "10%" : (""
- // + displayWidth + "%"), 1, isRuntimeColSortDisabled ? null : colId));
if (displayName != "Hidden") {
@@ -529,7 +511,6 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
} // for
int row = 0;
for (reportDataRows.resetNext(); reportDataRows.hasNext();) {
- //reportDataRows.getNext().getDataValue(colIdx).setVisible(newVisible);
DataRow dr = reportDataRows.getNext();
if(colIdx < dr.getDataValueList().size()) {
DataValue dv = dr.getDataValue(colIdx);
@@ -718,25 +699,16 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
DataValue dataValue = new DataValue();
String totalValue = tVal.getTotalValue();
- // if(colDisplayTotal.length()>0&&(!
- // colDisplayTotal.equals(AppConstants.TOTAL_SUM_ID)))
- // totalValue =
- // nvl(AppConstants.TOTAL_FUNCTIONS.getNameById(colDisplayTotal))+":
- // "+totalValue;
dataValue.setDisplayValue(totalValue);
//added below statement for displaying in excel as number
dataValue.setDisplayTotal("SUM(");
dataValue.setAlignment(totalsAlignment);
dataValue.setBold(true);
totalsDataRow.setDataValue(colIdx, dataValue);
-
- //totalsDataRow.addDataValue(dataValue);
} // if
} // for
- //reportDataRows.addDataRow(totalsDataRow);
- //dr.setRowValues(rowNameValues);
Vector rowNameValues = new Vector();
for (int i=0; i < reportRowHeaderCols.size(); i++) {
if(i==0) {
@@ -745,9 +717,7 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
dataValue.setAlignment("center");
dataValue.setDisplayValue("Total");
rowNameValues.add(dataValue);
- //rowNameValues.add("Total");
} else {
- //rowNameValues.add("");
DataValue dataValue = new DataValue();
dataValue.setDisplayValue("");
rowNameValues.add(dataValue);
@@ -757,7 +727,6 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
totalsDataRow.setRowValues(rowNameValues);
totalsDataRow.setRowNum(dataList.size());
dataList.add(totalsDataRow);
- //reportRowHeaderCols.getNext().addRowHeader(new RowHeader("", "30", 1, 0));
} // setColumnDataTotalsCrossTab
public void setRowDataTotalsCrossTab(Vector rowDataTotals, String totalsAlignment,
@@ -792,11 +761,6 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
DataValue dataValue = new DataValue();
String totalValue = tVal.getTotalValue();
- // if(rowDisplayTotal.length()>0&&(!
- // rowDisplayTotal.equals(AppConstants.TOTAL_SUM_ID)))
- // totalValue =
- // nvl(AppConstants.TOTAL_FUNCTIONS.getNameById(rowDisplayTotal))+":
- // "+totalValue;
dataValue.setDisplayValue(totalValue);
//added below statement for displaying in excel as number
dataValue.setDisplayTotal("SUM(");
@@ -813,20 +777,13 @@ public class ReportData extends org.onap.portalsdk.analytics.RaptorObject implem
String displayTotal, List dataList) {
DataValue dataValue = new DataValue();
- // if(displayTotal.length()>0&&(!
- // displayTotal.equals(AppConstants.TOTAL_SUM_ID)))
- // totalValue =
- // nvl(AppConstants.TOTAL_FUNCTIONS.getNameById(displayTotal))+":
- // "+totalValue;
dataValue.setDisplayValue(totalValue);
//added below statement for displaying in excel as number
dataValue.setDisplayTotal("SUM(");
dataValue.setAlignment(totalAlignment);
dataValue.setBold(true);
- //int colIdx = getDataColumnCount() - 1;
int rowIdx = getDataRowCount() - 1;
- //reportDataRows.getDataRow(rowIdx).getDataValueList().add(colIdx, dataValue);
DataRow dr = (DataRow)dataList.get(rowIdx);
dr.addDataValue(dr.getDataValueList().size(), dataValue);
} // setGrandTotalCrossTab