|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
RuleBaseContext.java | - | 100% | 100% | 100% |
|
1 | /* | |
2 | * $Id: RuleBaseContext.java,v 1.3 2005/02/02 00:23:22 mproctor Exp $ | |
3 | * | |
4 | * Copyright 2001-2003 (C) The Werken Company. All Rights Reserved. | |
5 | * | |
6 | * Redistribution and use of this software and associated documentation | |
7 | * ("Software"), with or without modification, are permitted provided that the | |
8 | * following conditions are met: | |
9 | * | |
10 | * 1. Redistributions of source code must retain copyright statements and | |
11 | * notices. Redistributions must also contain a copy of this document. | |
12 | * | |
13 | * 2. Redistributions in binary form must reproduce the above copyright notice, | |
14 | * this list of conditions and the following disclaimer in the documentation | |
15 | * and/or other materials provided with the distribution. | |
16 | * | |
17 | * 3. The name "drools" must not be used to endorse or promote products derived | |
18 | * from this Software without prior written permission of The Werken Company. | |
19 | * For written permission, please contact bob@werken.com. | |
20 | * | |
21 | * 4. Products derived from this Software may not be called "drools" nor may | |
22 | * "drools" appear in their names without prior written permission of The Werken | |
23 | * Company. "drools" is a trademark of The Werken Company. | |
24 | * | |
25 | * 5. Due credit should be given to The Werken Company. (http://werken.com/) | |
26 | * | |
27 | * THIS SOFTWARE IS PROVIDED BY THE WERKEN COMPANY AND CONTRIBUTORS ``AS IS'' | |
28 | * AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
29 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
30 | * ARE DISCLAIMED. IN NO EVENT SHALL THE WERKEN COMPANY OR ITS CONTRIBUTORS BE | |
31 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
32 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
33 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
34 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
35 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
36 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
37 | * POSSIBILITY OF SUCH DAMAGE. | |
38 | * | |
39 | */ | |
40 | package org.drools.spi; | |
41 | ||
42 | import java.io.ObjectInputStream; | |
43 | import java.io.Serializable; | |
44 | import java.util.HashMap; | |
45 | import java.util.Map; | |
46 | ||
47 | public class RuleBaseContext implements Serializable | |
48 | { | |
49 | private transient Map map = new HashMap( ); | |
50 | ||
51 | 30 | private void readObject(ObjectInputStream stream) |
52 | { | |
53 | 30 | map = new HashMap( ); |
54 | } | |
55 | ||
56 | 792 | public Object get(Object key) |
57 | { | |
58 | 792 | Object object = this.map.get( key ); |
59 | 792 | return object; |
60 | } | |
61 | ||
62 | 360 | public void put(Object key, |
63 | Object value) | |
64 | { | |
65 | 360 | this.map.put( key, |
66 | value ); | |
67 | } | |
68 | } |
|