KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > reasoner > rulesys > impl > oldCode > RuleInstance


1 /******************************************************************
2  * File: RuleInstance.java
3  * Created by: Dave Reynolds
4  * Created on: 03-May-2003
5  *
6  * (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
7  * [See end of file]
8  * $Id: RuleInstance.java,v 1.4 2005/02/21 12:18:05 andy_seaborne Exp $
9  *****************************************************************/

10 package com.hp.hpl.jena.reasoner.rulesys.impl.oldCode;
11
12 import com.hp.hpl.jena.reasoner.*;
13 import com.hp.hpl.jena.reasoner.rulesys.*;
14
15 /**
16  * Part of the backward chaining rule interpreter. A RuleInstance
17  * links an instance of a rule to the GoalResults object for which it is
18  * generating results. It is a simple data structure which is shared amongst
19  * a set of RuleSets to reduce the store turn over needed for RuleState creation.
20  * <p>
21  * Encapuslation warning: this object is used in the tight inner loop of the engine so we access its
22  * field pointers directly rather than through accessor methods.
23  * </p>
24  *
25  * @author <a HREF="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
26  * @version $Revision: 1.4 $ on $Date: 2005/02/21 12:18:05 $
27  */

28 public class RuleInstance {
29
30     /** The rule being processed */
31     protected Rule rule;
32     
33     /** The parent goal table entry which contains this continuation point */
34     protected GoalResults generator;
35     
36     /** The enclosing rule engine */
37     protected BRuleEngine engine;
38     
39     /** The head clause whose bindings are being sought */
40     protected TriplePattern head;
41     
42     /** Set to true if the first two body clauses were reordered for performance */
43     protected boolean clausesReordered = false;
44     
45     /** If the clauses are reordered this contains the index of the second clause */
46     protected int secondClause = -1;
47     
48     /**
49      * Constructor. Create a new continuation point for a rule in
50      * the context of a specific goal represented by the table entry.
51      */

52     RuleInstance(GoalResults results, Rule rule, TriplePattern head) {
53         this.generator = results;
54         this.rule = rule;
55         this.engine = results.getEngine();
56         this.head = head;
57     }
58      
59 }
60
61
62
63 /*
64     (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
65     All rights reserved.
66
67     Redistribution and use in source and binary forms, with or without
68     modification, are permitted provided that the following conditions
69     are met:
70
71     1. Redistributions of source code must retain the above copyright
72        notice, this list of conditions and the following disclaimer.
73
74     2. Redistributions in binary form must reproduce the above copyright
75        notice, this list of conditions and the following disclaimer in the
76        documentation and/or other materials provided with the distribution.
77
78     3. The name of the author may not be used to endorse or promote products
79        derived from this software without specific prior written permission.
80
81     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
82     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
83     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
84     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
85     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
86     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
87     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
88     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
89     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
90     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
91 */
Popular Tags