01: package org.drools.brms.client.decisiontable.model;
02:
03: /*
04: * Copyright 2005 JBoss Inc
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: public class Cell {
20: private int rowspan;
21: private int colspan;
22: private String value;
23: private Row row;
24: private Column column;
25:
26: Cell(Row row, Column col) {
27: this (row, col, 1, 1);
28: }
29:
30: Cell(final Row r, final Column c, final int colspan,
31: final int rowspan) {
32: this .row = r;
33: this .column = c;
34: this .colspan = colspan;
35: this .rowspan = rowspan;
36: }
37:
38: public void setValue(final String value) {
39: this .value = value;
40: }
41:
42: public int getRowIndex() {
43: return row.getIndex();
44: }
45:
46: public int getColumnIndex() {
47: return column.getIndex();
48: }
49:
50: public Row getRow() {
51: return row;
52: }
53:
54: public void setRow(Row row) {
55: this .row = row;
56: }
57:
58: public int getRowspan() {
59: return rowspan;
60: }
61:
62: public void setRowspan(int rowspan) {
63: this .rowspan = rowspan;
64: }
65:
66: public int getColspan() {
67: return colspan;
68: }
69:
70: public Column getColumn() {
71: return column;
72: }
73:
74: public String getValue() {
75: return value;
76: }
77:
78: public String toString() {
79: return "Cell[" + getRowIndex() + ", " + getColumnIndex() + ", "
80: + getValue() + "]";
81: }
82:
83: public void setColspan(int colspan) {
84: this.colspan = colspan;
85: }
86:
87: }
|