ubc.cs.JLog.Parser
Class pGenericPredicateEntry

java.lang.Object
  extended by ubc.cs.JLog.Parser.pPredicateEntry
      extended by ubc.cs.JLog.Parser.pGenericPredicateEntry
All Implemented Interfaces:
iName, iNameArity

public class pGenericPredicateEntry
extends pPredicateEntry

Dynamically constructs the iPredicate term from a description of the name, arity, and class name for the associated predicate class. It is suitable for predicates constructed directly from the jCompoundTerm passed into createPredicate.

Author:
Glendon Holst

Field Summary
protected static java.lang.Class[][] constructor_params_arrays
           
protected  java.lang.Class predicate_class
           
 
Fields inherited from class ubc.cs.JLog.Parser.pPredicateEntry
arity, library, name, NARY_ARITY
 
Constructor Summary
pGenericPredicateEntry(java.lang.String name, int arity, java.lang.Class p_class)
           
pGenericPredicateEntry(java.lang.String name, int arity, java.lang.String classname)
           
 
Method Summary
 iPredicate createPredicate(jCompoundTerm cterm)
          The internal method for creating the iPredicate representation of this predicate representation.
protected  java.lang.Object[] getConstructorArgsArray(jCompoundTerm cterm)
           
protected  java.lang.Class[] getConstructorParamsArray()
           
 
Methods inherited from class ubc.cs.JLog.Parser.pPredicateEntry
createPredicate, createPredicate, getArity, getLibrary, getName, isArity, sameLibrary, setLibrary, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

constructor_params_arrays

protected static final java.lang.Class[][] constructor_params_arrays

predicate_class

protected java.lang.Class predicate_class
Constructor Detail

pGenericPredicateEntry

public pGenericPredicateEntry(java.lang.String name,
                              int arity,
                              java.lang.String classname)

pGenericPredicateEntry

public pGenericPredicateEntry(java.lang.String name,
                              int arity,
                              java.lang.Class p_class)
Method Detail

createPredicate

public iPredicate createPredicate(jCompoundTerm cterm)
Description copied from class: pPredicateEntry
The internal method for creating the iPredicate representation of this predicate representation. Subclasses must override. The terms are provided, already created. The caller is responsible to ensure that arity and cterm.size match.

Specified by:
createPredicate in class pPredicateEntry
Parameters:
cterm - The collection of jTerms.
Returns:
iPredicate representing this predicate and its terms.

getConstructorParamsArray

protected final java.lang.Class[] getConstructorParamsArray()

getConstructorArgsArray

protected final java.lang.Object[] getConstructorArgsArray(jCompoundTerm cterm)