|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.declarativa.interprolog.PrologEngine | +--com.declarativa.interprolog.SubprocessEngine
A PrologEngine implemented over TCP/IP sockets. A SubprocessEngine object represents and gives access to a running Prolog process in background. Multiple instances correspond to multiple Prolog processes, outside the Java Virtual Machine.
Field Summary |
Fields inherited from class com.declarativa.interprolog.PrologEngine |
firstJavaMessageName, interrupting, MAX_INT_VALUE, MIN_INT_VALUE, nl, startPrologCommand, version |
Constructor Summary | |
SubprocessEngine(String startPrologCommand)
|
|
SubprocessEngine(String startPrologCommand,
boolean debug)
Construct a SubprocessEngine, launching a Prolog process in background. |
Method Summary | |
void |
addPrologOutputListener(PrologOutputListener client)
Add a PrologOutputListener to this engine. |
void |
addPrologStderrListener(OutputListener l)
|
void |
addPrologStdoutListener(OutputListener l)
Add a OutputListener to get output from Prolog's standard output. |
Object[] |
deterministicGoal(String G,
String OVar,
Object[] objectsP,
String RVars)
Synchronously calls a Prolog goal. |
boolean |
isAvailable()
Prolog is thought to be idle |
void |
removePrologOutputListener(PrologOutputListener client)
|
void |
removePrologStderrListener(OutputListener l)
|
void |
removePrologStdoutListener(OutputListener l)
|
void |
sendAndFlush(String s)
Sends a String to Prolog's input. |
void |
sendAndFlushLn(String s)
|
void |
shutdown()
Shuts down the background Prolog process as well as the dependent Java threads. |
Methods inherited from class com.declarativa.interprolog.PrologEngine |
abortTasks, assignableType, command, consultFromPackage, consultRelative, deterministicGoal, deterministicGoal, deterministicGoal, doCallback, findConstructor, findMethod, firstJavaMessage, getJarDirectory, getJarDirectory, getRealJavaObject, getRealJavaObject, getRealJavaObject, handleCallback, interrupt, interruptTasks, isDebug, isIdle, load_dynRelative, makeInvisible, printBindings, progressMessage, registerJavaObject, setDebug, shortClassName, teachMoreObjects, teachMoreObjects, teachOneObject, waitUntilAvailable, waitUntilIdle |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SubprocessEngine(String startPrologCommand, boolean debug)
startPrologCommand
- The command to launch Prolog, as if given from a console shell.
Must not be null.debug
- If true this engine will send debugging messages to System.outshutdown()
,
PrologEngine.teachMoreObjects(ObjectExamplePair[])
,
PrologEngine.setDebug(boolean)
public SubprocessEngine(String startPrologCommand)
Method Detail |
public void addPrologOutputListener(PrologOutputListener client)
client
- An object interested in receiving messages depicting Prolog's progressPrologOutputListener
public void removePrologOutputListener(PrologOutputListener client)
public void addPrologStdoutListener(OutputListener l)
OutputListener
public void addPrologStderrListener(OutputListener l)
public void removePrologStdoutListener(OutputListener l)
public void removePrologStderrListener(OutputListener l)
public boolean isAvailable()
isAvailable
in class PrologEngine
public void shutdown()
shutdown
in class PrologEngine
public void sendAndFlush(String s)
public void sendAndFlushLn(String s)
public Object[] deterministicGoal(String G, String OVar, Object[] objectsP, String RVars)
PrologEngine
deterministicGoal
in class PrologEngine
G
- Prolog goal termOVar
- Prolog variable that will be bound to objectsP arrayobjectsP
- Array of Java objects to pass to Prolog goalRVars
- Prolog list with object specifications, typically containing variables occurring in g.
If null a single binding will be returned, containing a TermModel object representing the goal term solution
PrologEngine.deterministicGoal(String)
,
PrologEngine.deterministicGoal(String,String)
,
PrologEngine.deterministicGoal(String,String,Object[])
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |