jdrew.oo.bu.builtins
Class BUBuiltin

java.lang.Object
  extended byjdrew.oo.bu.builtins.BUBuiltin
Direct Known Subclasses:
AssertBuiltin

public class BUBuiltin
extends java.lang.Object

This class allows the use of generic built-ins (Classes that properly implement the jdrew.oo.builtins.Builtin Interface) within the Bottom-Up (BU) engine. Generic built-ins must be wrapped for use in each engine to enable access proper access to the required data structures.

Title: OO jDREW

Description: Reasoning Engine for the Semantic Web - Supporting OO RuleML 0.88

Copyright: Copyright (c) 2005


Constructor Summary
BUBuiltin()
          Constructs a new empty Bottom-up built-in.
BUBuiltin(Builtin b)
          Constructs a new Bottom-Up built-in.
 
Method Summary
 java.util.Vector buildResult(DefiniteClause dc, int term)
          Builds the resulting fact from the call to this built-in if it exists.
 int getSymbol()
          Gets the integer symbol code for the built-in relation symbol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BUBuiltin

public BUBuiltin()
Constructs a new empty Bottom-up built-in. This is provided only for compatability reasons.


BUBuiltin

public BUBuiltin(Builtin b)
Constructs a new Bottom-Up built-in. The user should pass an instance of the Class that implements the generic built-in relation.

Parameters:
b - Builtin A generic built-in implementation class, this must implement the jdrew.oo.builtins.Builtin Interface.
Method Detail

getSymbol

public int getSymbol()
Gets the integer symbol code for the built-in relation symbol. This method simply calls the getSymbol() method of the generic built-in implementation that is referenced by this BUBuiltin object.

Returns:
int The integer code for the built-in relation symbol

buildResult

public java.util.Vector buildResult(DefiniteClause dc,
                                    int term)
Builds the resulting fact from the call to this built-in if it exists. This method extracts the appropriate Term object that represents the call to the built-in relation and passes to the generic built-in's builtResult() method.

Parameters:
dc - DefiniteClause The clause that contains the call to the built-in
term - int The index into the atoms of the clause for the call to the built-in relation represented by this BUBuiltin object.
Returns:
Vector A vector containing a fact that will unify with the call to the built-in if it should succeed. null or a fact that will not unify (null is preferred as it is more efficient) should be returned if the call to built-in relation should not succeed.