1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.seasar.tuigwaa.database;
17
18 import java.util.Collection;
19 import java.util.List;
20 import java.util.Map;
21
22 import com.isenshi.util.TableMap;
23
24 public class SpreadSheetImpl extends AbstractDataTable implements SpreadSheet {
25
26 private TableMap dataMap;
27
28 private List rowHeaders;
29
30 private String dataLabel;
31
32 private String rowLabel;
33
34 private String columnLabel;
35
36 public SpreadSheetImpl(String name, String dataLabel, String rowLabel, List rowHeaders, String columnLabel, List columnHeaders, TableMap dataMap) {
37 super(name, columnHeaders, columnHeaders);
38 this.dataMap = dataMap;
39 this.rowHeaders = rowHeaders;
40 this.rowLabel = rowLabel;
41 this.columnLabel = columnLabel;
42 }
43
44 public void setFilterMap(Map filterMap) {
45
46 }
47
48 public String getDataLabel() {
49 return dataLabel;
50 }
51
52 public String getRowLabel() {
53 return rowLabel;
54 }
55
56 public String getColumnLabel() {
57 return columnLabel;
58 }
59
60 protected void remove(int rowIndex) {
61 }
62
63 public List getColumnHeaders() {
64 return getHeaders();
65 }
66
67 public List getRowHeaders() {
68 return rowHeaders;
69 }
70
71 public String getRowHeader(){
72 return getRowHeader(getCurrentRow());
73 }
74
75 public String getRowHeader(int index){
76 return String.valueOf(getRowHeaders().get(index));
77 }
78
79 public String getCurrentRowHeader(){
80 return getRowHeader(getCurrentRow());
81 }
82
83 public int getRowSize() {
84 return rowHeaders.size();
85 }
86
87 public Object getData(int row, int column) {
88 if(row<0||column<0){
89 return null;
90 }
91 String rowLabel = (String) rowHeaders.get(row);
92 String columnLabel = (String) getHeader(column);
93 return dataMap.get(rowLabel, columnLabel);
94 }
95
96 public Collection getDataList() {
97 throw new UnsupportedOperationException();
98 }
99
100 public Object getRowObject(int row) {
101 throw new UnsupportedOperationException();
102 }
103
104 public Map getDataMap(int row) {
105 throw new UnsupportedOperationException();
106 }
107 }