sleep.bridges

Class BasicUtilities

Implemented Interfaces:
Function, Serializable, Loadable, Predicate

public class BasicUtilities
extends Object
implements Function, Loadable, Predicate

implementation of basic utility functions

Method Summary

boolean
decide(String predName, ScriptInstance anInstance, Stack terms)
decides the truthfulness of the proposition predicateName applied to the passedInTerms.
Scalar
evaluate(String n, ScriptInstance i, Stack l)
boolean
scriptLoaded(ScriptInstance i)
boolean
scriptUnloaded(ScriptInstance i)

Method Details

decide

public boolean decide(String predName,
                      ScriptInstance anInstance,
                      Stack terms)
decides the truthfulness of the proposition predicateName applied to the passedInTerms.
Specified by:
decide in interface Predicate
Parameters:
anInstance - an instance of the script asking about this predicate.
Returns:
a boolean, in the case of a predicate == and the terms [3, 4] we know 3 == 4 is false so return false.

evaluate

public Scalar evaluate(String n,
                       ScriptInstance i,
                       Stack l)
Specified by:
evaluate in interface Function

scriptLoaded

public boolean scriptLoaded(ScriptInstance i)
Specified by:
scriptLoaded in interface Loadable

scriptUnloaded

public boolean scriptUnloaded(ScriptInstance i)
Specified by:
scriptUnloaded in interface Loadable