|
|
com.declarativa.interprolog
|
Field Summary |
Fields inherited from class com.declarativa.interprolog.AbstractPrologEngine |
firstJavaMessageName, interrupting, nl, prologBinDirectoryOrCommand |
Fields inherited from interface com.declarativa.interprolog.PrologEngine |
MAX_INT_VALUE, MIN_INT_VALUE, version |
Constructor Summary | |
SubprocessEngine()
|
|
SubprocessEngine(boolean debug)
|
|
SubprocessEngine(String startPrologCommand)
|
|
SubprocessEngine(String prologCommand,
boolean debug)
|
|
SubprocessEngine(String prologCommand,
boolean debug,
boolean loadFromJar)
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 client)
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 |
boolean |
realCommand(String s)
This implementation may get stuck if the command includes variables, because the Prolog top level interpreter may offer to compute more solutions; use variables prefixed with '_' |
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 |
setDebug(boolean debug)
Show (or hide) debug messages, both Java and Prolog side, cf. ipIsDebugging/0. |
void |
shutdown()
Shuts down the background Prolog process as well as the dependent Java threads. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SubprocessEngine(String prologCommand, boolean debug, boolean loadFromJar)
prologCommand
- 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()
,
AbstractPrologEngine.teachMoreObjects(ObjectExamplePair[])
,
setDebug(boolean)
public SubprocessEngine(String prologCommand, boolean debug)
public SubprocessEngine(String startPrologCommand)
public SubprocessEngine(boolean debug)
public SubprocessEngine()
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 client)
client
- An object interested in Prolog's standard outputOutputListener
public void addPrologStderrListener(OutputListener l)
public void removePrologStdoutListener(OutputListener l)
public void removePrologStderrListener(OutputListener l)
public void setDebug(boolean debug)
AbstractPrologEngine
setDebug
in interface PrologEngine
setDebug
in class AbstractPrologEngine
public boolean isAvailable()
isAvailable
in interface PrologEngine
isAvailable
in class AbstractPrologEngine
public void shutdown()
shutdown
in interface PrologEngine
shutdown
in class AbstractPrologEngine
public void sendAndFlush(String s)
public void sendAndFlushLn(String s)
public boolean realCommand(String s)
realCommand
in class AbstractPrologEngine
AbstractPrologEngine.command(String)
public Object[] deterministicGoal(String G, String OVar, Object[] objectsP, String RVars)
AbstractPrologEngine
deterministicGoal
in interface PrologEngine
deterministicGoal
in class AbstractPrologEngine
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
AbstractPrologEngine.deterministicGoal(String)
,
AbstractPrologEngine.deterministicGoal(String,String)
,
AbstractPrologEngine.deterministicGoal(String,String,Object[])
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Declarativa - Serviços de Informática, Lda. |