01: /*
02: * Copyright 2002-2005 Peter Lin & RuleML.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://ruleml-dev.sourceforge.net/
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: *
16: */
17: package org.drools.facttemplates;
18:
19: /**
20: * @author Peter Lin
21: *
22: * Base interface for Facts
23: */
24: public interface Fact {
25:
26: /**
27: * Return the value at the given field index
28: * @param id
29: * @return
30: */
31: Object getFieldValue(int index);
32:
33: Object getFieldValue(String name);
34:
35: void setFieldValue(String name, Object value);
36:
37: void setFieldValue(int index, Object value);
38:
39: /**
40: * Return the unique ID for the fact
41: * @return
42: */
43: long getFactId();
44:
45: /**
46: * Return the Deftemplate for the fact
47: * @return
48: */
49: FactTemplate getFactTemplate();
50: }
|