01: /*
02: * JFolder, Copyright 2001-2006 Gary Steinmetz
03: *
04: * Distributable under LGPL license.
05: * See terms of license at gnu.org.
06: */
07:
08: package org.jfolder.workflow.query;
09:
10: //base classes
11: import java.math.BigDecimal;
12: import java.util.ArrayList;
13:
14: //project specific classes
15:
16: //other classes
17:
18: public class ResultSetContainer {
19:
20: private ArrayList values = null;
21:
22: private ResultSetContainer() {
23: this .values = new ArrayList();
24: }
25:
26: public final static ResultSetContainer createResultSet() {
27: ResultSetContainer outValue = new ResultSetContainer();
28: return outValue;
29: }
30:
31: public int getRowCount() {
32: return this .values.size();
33: }
34:
35: public ArrayList createEmptyRow(ColumnContainer inCc) {
36: ArrayList outValue = new ArrayList();
37: for (int i = 0; i < inCc.getColumnCount(); i++) {
38: outValue.add(null);
39: }
40: this .values.add(outValue);
41: return outValue;
42: }
43:
44: public String getValueAsString(int inRow, int inColumn) {
45: ArrayList row = ((ArrayList) this .values.get(inRow));
46: return ((String) row.get(inColumn));
47: }
48:
49: public BigDecimal getValueAsDecimal(int inRow, int inColumn) {
50: ArrayList row = ((ArrayList) this .values.get(inRow));
51: return ((BigDecimal) row.get(inColumn));
52: }
53:
54: public Boolean getValueAsBoolean(int inRow, int inColumn) {
55: ArrayList row = ((ArrayList) this .values.get(inRow));
56: return ((Boolean) row.get(inColumn));
57: }
58: }
|