01: package org.drools.reteoo;
02:
03: import org.drools.common.DefaultFactHandle;
04: import org.drools.common.InternalFactHandle;
05:
06: /*
07: * Copyright 2005 JBoss Inc
08: *
09: * Licensed under the Apache License, Version 2.0 (the "License");
10: * you may not use this file except in compliance with the License.
11: * You may obtain a copy of the License at
12: *
13: * http://www.apache.org/licenses/LICENSE-2.0
14: *
15: * Unless required by applicable law or agreed to in writing, software
16: * distributed under the License is distributed on an "AS IS" BASIS,
17: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18: * See the License for the specific language governing permissions and
19: * limitations under the License.
20: */
21:
22: public class InitialFactHandle extends DefaultFactHandle {
23: /**
24: *
25: */
26: private static final long serialVersionUID = 400L;
27:
28: private final InternalFactHandle delegate;
29:
30: private Object object;
31:
32: public InitialFactHandle(final InternalFactHandle delegate) {
33: super ();
34: this .delegate = delegate;
35: this .object = InitialFactImpl.getInstance();
36: }
37:
38: // ----------------------------------------------------------------------
39: // Instance members
40: // ----------------------------------------------------------------------
41:
42: /**
43: * @see Object
44: */
45: public boolean equals(final Object object) {
46: return this .delegate.equals(object);
47: }
48:
49: /**
50: * @see Object
51: */
52: public int hashCode() {
53: return this .delegate.hashCode();
54: }
55:
56: /**
57: * @see Object
58: */
59: public String toString() {
60: return toExternalForm();
61: }
62:
63: public long getRecency() {
64: return this .delegate.getRecency();
65: }
66:
67: public void setRecency(final long recency) {
68: this .delegate.setRecency(recency);
69: }
70:
71: public long getId() {
72: return this .delegate.getId();
73: }
74:
75: public void invalidate() {
76: this .delegate.invalidate();
77: }
78:
79: public Object getObject() {
80: return this .object;
81: }
82:
83: public void setObject(final Object object) {
84: // do nothign
85: }
86:
87: public String toExternalForm() {
88: return "InitialFact";
89: }
90:
91: }
|