f6696ccd5ff27f4cefad4e4f899373f47eab5c8b
[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.model.search;
21
22 import java.util.*;
23
24 class ColumnContent {
25         String columnId;
26         SearchResultField searchresultField;
27         
28     public ColumnContent(String columnId, SearchResultField searchresultField) {
29         this.columnId = columnId;
30         this.searchresultField = searchresultField;
31     }
32         public String getColumnId() {
33                 return columnId;
34         }
35         public void setColumnId(String columnId) {
36                 this.columnId = columnId;
37         }
38         public SearchResultField getSearchresultField() {
39                 return searchresultField;
40         }
41         public void setSearchresultField(SearchResultField searchresultField) {
42                 this.searchresultField = searchresultField;
43         }
44         
45         
46         
47 }
48 public class SearchResultRow extends ArrayList {
49         
50
51         //private SearchResultField searchresultField;
52         private int nextElemIdx = 0;
53
54         public void resetNext() {
55                 resetNext(0);
56         } // resetNext
57
58         public void resetNext(int toPos) {
59                 nextElemIdx = toPos;
60         } // resetNext
61
62         public boolean hasNext() {
63                 return (nextElemIdx < size());
64         } // hasNext
65
66         public SearchResultField getNext() {
67                 return hasNext() ? getSearchResultField(nextElemIdx++) : null;
68         } // getNext
69
70         public SearchResultField getSearchResultField(int idx) {
71                 return (SearchResultField) get(idx);
72         } // getRowHeader
73
74         public void addSearchResultField(SearchResultField searchResultField) {
75                 add(searchResultField);
76         } // addSearchResultField
77
78         public void addSearchResultField(int idx, SearchResultField searchResultField) {
79                 add(idx, searchResultField);
80         } // addSearchResultField
81         
82         public void addColumnContent(ColumnContent cc ) {
83                 
84                 add(cc);
85         } // addSearchResultField
86
87         public void addColumnContent(int idx, ColumnContent cc) {
88                 add(idx, cc);
89         } // addSearchResultField       
90
91         
92 } // SearchResultRow