f887e5f2de6af2392ec3f95c6c8f5958481b2801
[portal/sdk.git] /
1 /*-
2  * ================================================================================
3  * eCOMP Portal SDK
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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  * ================================================================================
19  */
20 package org.openecomp.portalsdk.analytics.view;
21
22 import java.util.*;
23
24 public class ReportRowHeaderCols extends Vector {
25         private int nextElemIdx = 0;
26
27         public void resetNext() {
28                 resetNext(0);
29         } // resetNext
30
31         public void resetNext(int toPos) {
32                 nextElemIdx = toPos;
33         } // resetNext
34
35         public boolean hasNext() {
36                 return (nextElemIdx < size());
37         } // hasNext
38
39         public RowHeaderCol getNext() {
40                 return hasNext() ? getRowHeaderCol(nextElemIdx++) : null;
41         } // getNext
42
43         public RowHeader getRowHeader(int colIdx, int rowIdx) {
44                 return getRowHeaderCol(colIdx).getRowHeader(rowIdx);
45         } // getRowHeader
46
47         public RowHeaderCol getRowHeaderCol(int idx) {
48                 return (RowHeaderCol) get(idx);
49         } // getRowHeaderCol
50
51         public void addRowHeaderCol(RowHeaderCol rowHeaderCol) {
52                 add(rowHeaderCol);
53         } // addRowHeaderCol
54
55         public void addRowHeaderCol(int idx, RowHeaderCol rowHeaderCol) {
56                 add(idx, rowHeaderCol);
57         } // addRowHeaderCol
58
59         public int getRowCount() {
60                 int cSize = 0;
61                 if (getColumnCount() > 0)
62                         cSize = getRowHeaderCol(0).size();
63
64                 return cSize;
65         } // getRowCount
66
67         public int getColumnCount() {
68                 return size();
69         } // getColumnCount
70
71 } // ReportRowHeaderCols