JTP API Documentation

jtp.frame.listen
Class ListenerTemplate

java.lang.Object
  |
  +--jtp.frame.listen.ListenerTemplate
All Implemented Interfaces:
Serializable, Unifyable
Direct Known Subclasses:
TripleTemplate, VCTemplate, VLTemplate

public abstract class ListenerTemplate
extends Object
implements Unifyable, Serializable

This abstract class represents templates which will ultimately be used to generate some other object.

See Also:
Serialized Form

Constructor Summary
ListenerTemplate()
           
 
Method Summary
protected abstract  AbstractVCListener createListener(Object val, Object comparisonVal, Symbol comparisonSign, VCListenerCreationReasoningStep rs)
          The template instance returns a AbstractVCListener that can instantiate the template given a concrete object as input.
protected static Literal createLiteral(Object slot, Object frame, Object val, boolean polarity)
           
protected abstract  Clause getClause()
          The template instance returns a Clause that, as close as possible, indicates what this template represents in FOL.
protected static Object instantiateTemplate(Object template)
           
 boolean unify(Object param1, List param2)
          Attempts to unify with another object, that is find a variable assignment that will make the two objects equal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jtp.fol.Unifyable
contains, deReferenceVariables, getVariables
 

Constructor Detail

ListenerTemplate

public ListenerTemplate()
Method Detail

createListener

protected abstract AbstractVCListener createListener(Object val,
                                                     Object comparisonVal,
                                                     Symbol comparisonSign,
                                                     VCListenerCreationReasoningStep rs)
The template instance returns a AbstractVCListener that can instantiate the template given a concrete object as input.


getClause

protected abstract Clause getClause()
The template instance returns a Clause that, as close as possible, indicates what this template represents in FOL.


createLiteral

protected static Literal createLiteral(Object slot,
                                       Object frame,
                                       Object val,
                                       boolean polarity)

instantiateTemplate

protected static Object instantiateTemplate(Object template)

unify

public boolean unify(Object param1,
                     List param2)
Description copied from interface: Unifyable
Attempts to unify with another object, that is find a variable assignment that will make the two objects equal. If the unification is sucessful, the state of the participating variables is changed, i.e. they receive values. These variables are added to the variable stack. If the function returned true, but the stack didn't grow, then the two objects were probably equal to begin with.

Specified by:
unify in interface Unifyable
Parameters:
param1 - the object to unify with.
param2 - the variable stack
Returns:
true if successful

JTP API Documentation