2 * ================================================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ================================================================================
20 package org.openecomp.portalsdk.analytics.view;
24 import org.openecomp.portalsdk.analytics.error.*;
25 import org.openecomp.portalsdk.analytics.system.*;
26 import org.openecomp.portalsdk.analytics.util.*;
28 public class CrossTabColumnValues extends org.openecomp.portalsdk.analytics.RaptorObject {
29 private String colId = null;
31 private Vector columnValues = null;
33 public CrossTabColumnValues(String colId, String loadValuesSQL, String dbInfo)
34 throws RaptorException {
36 DataSet ds = ConnectionUtils.getDataSet(loadValuesSQL, dbInfo);
37 // DataSet ds = DbUtils.executeQuery(loadValuesSQL);
38 columnValues = new Vector(ds.getRowCount());
39 for (int i = 0; i < ds.getRowCount(); i++)
40 columnValues.add(ds.getString(i, 0));
41 } // CrossTabColumnValues
43 public String getColId() {
47 public Vector getColumnValues() {
51 public int getValuesCount() {
52 return columnValues.size();
55 public String getValueAt(int idx) {
56 return (String) columnValues.get(idx);
59 public int getIndexOf(String value) {
60 for (int i = 0; i < getValuesCount(); i++)
61 if (value.equals(getValueAt(i)))
67 public int getIndexOf(int value) {
68 for (int i = 0; i < getValuesCount(); i++)
69 if (value == new Integer(getValueAt(i)).intValue())
75 } // CrossTabColumnValues