public class PrologEnvironment
extends com.googlecode.prolog_cafe.lang.BufferingPrologControl
This class is not thread safe.
A single copy of the Prolog interpreter, for the current thread.
Modifier and Type | Class and Description |
---|---|
static class |
PrologEnvironment.Args |
static interface |
PrologEnvironment.Factory |
Modifier and Type | Method and Description |
---|---|
void |
addToCleanup(Runnable task)
Adds cleanup task to run when close() is called
|
void |
close()
Release resources stored in interpreter's hash manager.
|
void |
copyStoredValues(PrologEnvironment child)
Copy the stored values from another interpreter to this one.
|
<T> T |
get(StoredValue<T> sv)
Lookup a stored value in the interpreter's hash manager.
|
PrologEnvironment.Args |
getArgs() |
int |
getReductions() |
boolean |
isEngineStopped() |
<T> void |
set(StoredValue<T> sv,
T obj)
Set a stored value on the interpreter's hash manager.
|
void |
setCleanup(List<Runnable> newCleanupList)
Assign the environment a cleanup list (in order to use a centralized list)
If this enivronment's list is non-empty, append its cleanup tasks to the
assigning list.
|
void |
setPredicate(com.googlecode.prolog_cafe.lang.Predicate goal) |
all, all, execute, fail, initialize, once, once, success
public PrologEnvironment.Args getArgs()
public boolean isEngineStopped()
isEngineStopped
in class com.googlecode.prolog_cafe.lang.BufferingPrologControl
public void setPredicate(com.googlecode.prolog_cafe.lang.Predicate goal)
setPredicate
in class com.googlecode.prolog_cafe.lang.PrologControl
public int getReductions()
public <T> T get(StoredValue<T> sv)
T
- type of stored Java object.sv
- unique key.public <T> void set(StoredValue<T> sv, T obj)
T
- type of stored Java object.sv
- unique key.obj
- the value to store under sv
.public void copyStoredValues(PrologEnvironment child)
public void setCleanup(List<Runnable> newCleanupList)
public void addToCleanup(Runnable task)
task
- is run when close() is calledpublic void close()