01: package org.drools.reteoo;
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: import org.drools.InitialFact;
20:
21: /**
22: * We dont want users to be able to instantiate InitialFact so we expose it as
23: * an interface and make the class and its constructor package protected
24: *
25: * @author <a href="mailto:mark.proctor@jboss.com">Mark Proctor</a>
26: * @author <a href="mailto:bob@werken.com">Bob McWhirter</a>
27: *
28: */
29: final class InitialFactImpl implements InitialFact {
30: private static final InitialFact INSTANCE = new InitialFactImpl();
31:
32: private final int hashCode = "InitialFactImpl".hashCode();
33:
34: public static InitialFact getInstance() {
35: return InitialFactImpl.INSTANCE;
36: }
37:
38: private InitialFactImpl() {
39: }
40:
41: public int hashCode() {
42: return this .hashCode;
43: }
44:
45: public boolean equals(final Object object) {
46: if (this == object) {
47: return true;
48: }
49:
50: if (object == null || !(object instanceof InitialFactImpl)) {
51: return false;
52: }
53:
54: return true;
55: }
56: }
|