JTP API Documentation

jtp.frame.listen
Class VLTemplate

java.lang.Object
  |
  +--jtp.frame.listen.ListenerTemplate
        |
        +--jtp.frame.listen.VLTemplate
All Implemented Interfaces:
Serializable, Unifyable

public class VLTemplate
extends ListenerTemplate

See Also:
Serialized Form

Method Summary
 boolean contains(Variable v)
          Checks if this Unifyable contains a given Variable (in that case, they cannot be unified).
protected  AbstractVCListener createListener(Object value, Object comparisonVal, Symbol comparisonSign, VCListenerCreationReasoningStep rs)
          The template instance returns a AbstractVCListener that can instantiate the template given a concrete object as input.
 Object deReferenceVariables()
          Replaces all the variables in this Unifyable by their values.
protected  Clause getClause()
          The template instance returns a Clause that, as close as possible, indicates what this template represents in FOL.
 Collection getVariables(Collection tgt)
          Retrieves the variables in this Unifyable and places them into a provided target collection.
 String toString()
           
 
Methods inherited from class jtp.frame.listen.ListenerTemplate
createLiteral, instantiateTemplate, unify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

createListener

protected AbstractVCListener createListener(Object value,
                                            Object comparisonVal,
                                            Symbol comparisonSign,
                                            VCListenerCreationReasoningStep rs)
Description copied from class: ListenerTemplate
The template instance returns a AbstractVCListener that can instantiate the template given a concrete object as input.

Specified by:
createListener in class ListenerTemplate

contains

public boolean contains(Variable v)
Description copied from interface: Unifyable
Checks if this Unifyable contains a given Variable (in that case, they cannot be unified). The simplest (if not always the most efficient) implementation is to delegate u.contains(v) to u.getVariables(null).contains(v).

Parameters:
v - the variable to look for
Returns:
true if the variable was found in this Unifyable.

getVariables

public Collection getVariables(Collection tgt)
Description copied from interface: Unifyable
Retrieves the variables in this Unifyable and places them into a provided target collection.

Parameters:
tgt - the collection to which the variables are added. If null, and this Unifyable contains variables, a new collection is created.
Returns:
the target collection. If target is null, and there are no variables, null is returned; if a new collection is created, it has to be modifyable.

deReferenceVariables

public Object deReferenceVariables()
Description copied from interface: Unifyable
Replaces all the variables in this Unifyable by their values. If a value is, in its turn, a variable, the process is repeated.

Returns:
the copy of this Unifyable with all variables de-referenced. In many subclass implementations, this is returned if no variables needed to be dereferenced.
See Also:
Variable

toString

public String toString()
Overrides:
toString in class Object

getClause

protected Clause getClause()
Description copied from class: ListenerTemplate
The template instance returns a Clause that, as close as possible, indicates what this template represents in FOL.

Specified by:
getClause in class ListenerTemplate

JTP API Documentation