is.lill.acre.logic
Class Bindings

java.lang.Object
  extended by is.lill.acre.logic.Bindings

public class Bindings
extends java.lang.Object

Track variable bindings within a conversation


Constructor Summary
Bindings()
           
 
Method Summary
 void addBinding(Term k, Term v)
          Add a binding for a term
 boolean binds(Term term)
          Find if a binding is present for a given variable
 Term getBindingFor(Term t)
          Get the bindings for a term
 java.lang.String toString()
          Get a string representation of this set of bindings
 void update(Bindings b)
          Update this set of bindings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Bindings

public Bindings()
Method Detail

binds

public boolean binds(Term term)
Find if a binding is present for a given variable

Parameters:
term - A term to be checked
Returns:
true if term is a variable and a binding exists for it.

getBindingFor

public Term getBindingFor(Term t)
Get the bindings for a term

Parameters:
t - The term to check the bindings for
Returns:
The bindings for the supplied term, or null if t is not a variable or if no appropriate binding exists

addBinding

public void addBinding(Term k,
                       Term v)
Add a binding for a term

Parameters:
k - The variable to create the value for
v - The value to be bound to the variable k

toString

public java.lang.String toString()
Get a string representation of this set of bindings

Overrides:
toString in class java.lang.Object
Returns:
A human-readable string describing the bindings stored in this object

update

public void update(Bindings b)
Update this set of bindings

Parameters:
b - Another set of bindings to be added to this object. Overrides conflicting bindings.