]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.workbench.search/src/org/simantics/workbench/search/SearchResult.java
Index tokenized lowercase versions of name and types for UI searches
[simantics/platform.git] / bundles / org.simantics.workbench.search / src / org / simantics / workbench / search / SearchResult.java
1 package org.simantics.workbench.search;
2
3 import java.util.ArrayList;
4 import java.util.List;
5
6
7 /**
8  * Search result.
9  * 
10  * @author Marko Luukkainen
11  */
12 public class SearchResult {
13
14         public List<SearchResultColumn> columns;
15     public List<SearchResultRow> rows;
16     
17     public SearchResult() {
18                 columns = new ArrayList<SearchResultColumn>();
19                 rows = new ArrayList<SearchResultRow>();
20         }
21
22     public SearchResult(List<SearchResultColumn> columns) {
23                 this.columns = columns;
24                 rows = new ArrayList<SearchResultRow>();
25         }
26     
27     public void addColumn(SearchResultColumn column) {
28         columns.add(column);
29     }
30     
31     public void addRow(SearchResultRow row) {
32         rows.add(row);
33     }
34     
35     public List<SearchResultColumn> getColumns() {
36                 return columns;
37         }
38     
39     public List<SearchResultRow> getRows() {
40                 return rows;
41         }
42     
43     public int columnCount() {
44         return columns.size();
45     }
46     
47     public int rowCount() {
48         return rows.size();
49     }
50     
51     public SearchResult subset(int start, int end) {
52         SearchResult copy = new SearchResult(columns);
53         copy.rows = rows.subList(start, end);
54         return copy;
55     }
56     
57     public boolean isEmpty() {
58         return rows.isEmpty();
59     }
60
61 }