01: package org.drools.decisiontable.parser;
02:
03: import java.util.Map;
04:
05: /*
06: * Copyright 2005 JBoss Inc
07: *
08: * Licensed under the Apache License, Version 2.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.apache.org/licenses/LICENSE-2.0
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: */
20:
21: /**
22: * @author <a href="mailto:stevearoonie@gmail.com">Steven Williams</a>
23: *
24: * A cell in a decision table
25: */
26: public class Cell {
27: Row row;
28:
29: Object value;
30:
31: Column column;
32:
33: public Cell() {
34:
35: }
36:
37: Cell(Row r, Column c) {
38: row = r;
39: column = c;
40: }
41:
42: public void setValue(String v) {
43: value = column.getValue(v);
44: }
45:
46: public String toString() {
47: return "Cell[" + column + ": " + value + "]";
48: }
49:
50: public Row getRow() {
51: return row;
52: }
53:
54: public String getColumn() {
55: return column.getName();
56: }
57:
58: public Object getValue() {
59: return value;
60: }
61:
62: public void addValue(Map vars) {
63: column.addValue(vars, value);
64: }
65: }
|