All Packages Class Hierarchy This Package Previous Next Index
Class JIP.engine.JIPEngine
java.lang.Object
|
+----JIP.engine.JIPEngine
- public class JIPEngine
- extends Object
- implements SolutionConsumer
JIPEngine implements the JIProlog interpeter. It is the main class of the package
- Version:
- 4.x.x
Home Page : http:\\www.geocities.com\jiprolog
- Author:
- Ugo Chirico 2000
-
JIPEngine(Frame, String, DataInputStream, PrintStream)
- Constructor
-
addErrorListener(JIPErrorListener)
- Add an ErrorListener
-
addEventListener(JIPEventListener)
- Add an EventListener
-
addTraceListener(JIPTraceListener)
- add a TraceListener
-
closeAllQueries()
- Close all pending queries
-
closeQuery(int)
- Close the query.
-
consultFile(String)
- Consult a file from a file
-
consultInputStream()
- Consult a file from the input stream
-
consultStream(DataInputStream)
- Consult a stream
-
finalize()
- Release the resources used by JIP
-
getBasePath()
- Get the base path
-
getErrorListeners()
- Get the list of ErrorListeners
-
getEventListeners()
- Get the list of EventListeners
-
getInputStream()
- Get InputStream
-
getMainFrame()
-
-
getOutputStream()
- Get OutputStream
-
getTraceListeners()
- Get the list of TraceListener
-
getVersion()
- Version
Return the jiprolog API version
-
moreSolutions(int)
- Check if there is one more solution
-
nextSolution(int)
- Search for another soution.
-
openQuery(JIPTerm)
- Open a query.
-
openQuery(String)
- Open a query.
-
reset()
- Close all pending queries, reset the prolog interpreter and clear the database
-
setBasePath(String)
- Set the base path of the engine
-
setInputStream(DataInputStream)
- Set InputStream
-
setMainFrame(Frame)
- Set the Main Frame of the interpreter
-
setOutputStream(PrintStream)
- Set OutputStream
-
setTrace(boolean)
- Set trace flag
-
update(int, Object)
-
JIPEngine
public JIPEngine(Frame mainFrame,
String strBasePath,
DataInputStream ins,
PrintStream outs)
- Constructor
- Parameters:
- mainFrame - main frame to be used in built-ins those use Windows
- strBasePath - Base Path of the application or applet
- ins - Input Stream
- outs - Output Stream
getVersion
public static String getVersion()
- Version
Return the jiprolog API version
addEventListener
public void addEventListener(JIPEventListener listener)
- Add an EventListener
- Parameters:
- listener - EventListener to add
- See Also:
- JIPEventListener
getEventListeners
public Vector getEventListeners()
- Get the list of EventListeners
- See Also:
- JIPEventListener
addErrorListener
public void addErrorListener(JIPErrorListener listener)
- Add an ErrorListener
- Parameters:
- listener - ErrorListener to add
- See Also:
- JIPErrorListener
getErrorListeners
public Vector getErrorListeners()
- Get the list of ErrorListeners
- See Also:
- JIPErrorListener
addTraceListener
public void addTraceListener(JIPTraceListener traceListener)
- add a TraceListener
- Parameters:
- listener - TraceEventListener to set
- See Also:
- JIPTraceEventListener
getTraceListeners
public Vector getTraceListeners()
- Get the list of TraceListener
- See Also:
- JIPTraceListener
setMainFrame
public void setMainFrame(Frame fr)
- Set the Main Frame of the interpreter
- Parameters:
- fr - Main frame to be used in built-ins those use Windows
setBasePath
public void setBasePath(String strPath)
- Set the base path of the engine
- Parameters:
- strPath - Base path
getBasePath
public String getBasePath()
- Get the base path
- Returns:
- the base path of the engine
setTrace
public void setTrace(boolean bTrace)
- Set trace flag
- Parameters:
- bTrace - Trace flag
setOutputStream
public void setOutputStream(PrintStream outs)
- Set OutputStream
- Parameters:
- outs - PrintStream
getOutputStream
public PrintStream getOutputStream()
- Get OutputStream
getInputStream
public DataInputStream getInputStream()
- Get InputStream
setInputStream
public void setInputStream(DataInputStream ins)
- Set InputStream
- Parameters:
- ins - DataInputStream
reset
public void reset()
- Close all pending queries, reset the prolog interpreter and clear the database
consultInputStream
public boolean consultInputStream()
- Consult a file from the input stream
consultStream
public boolean consultStream(DataInputStream ins)
- Consult a stream
consultFile
public boolean consultFile(String strFilePath)
- Consult a file from a file
openQuery
public int openQuery(String strQuery) throws JIPSyntaxErrorException
- Open a query. When a solution is found the JIPEventListeners will be notified JIPEventListeners will be notified in openNotified
- Parameters:
- strQuery - Query as a text string
- Returns:
- The handle of the query open
- See Also:
- nextSolution, closeQuery, openNotified
openQuery
public synchronized int openQuery(JIPTerm jipquery)
- Open a query. When a solution is found the JIPEventListeners will be notified in openNotified
- Parameters:
- query - Query as a JIPTerm
- Returns:
- The handle of the query open
- See Also:
- parseQuery, nextSolution, closeQuery, openNotified
nextSolution
public synchronized void nextSolution(int nQueryHandle)
- Search for another soution. When a solution is found the JIPEventListeners will be notified in moreNotified
- Parameters:
- nQueryHandle - the handle of the query
- See Also:
- openQuery, closeQuery, moreNotified
closeQuery
public synchronized void closeQuery(int nQueryHandle)
- Close the query. If the query specified in the handle is valid JIPEventListeners will be notified in closeNotify
- Parameters:
- nQueryHandle - the handle of the query
- See Also:
- nextSolution, closeQuery, closeNotified
moreSolutions
public synchronized boolean moreSolutions(int nQueryHandle)
- Check if there is one more solution
- Parameters:
- nQueryHandle - the handle of the query
closeAllQueries
public synchronized void closeAllQueries()
- Close all pending queries
update
public final synchronized void update(int nQueryHandle,
Object obj)
getMainFrame
public Frame getMainFrame()
finalize
public void finalize()
- Release the resources used by JIP
- Overrides:
- finalize in class Object
All Packages Class Hierarchy This Package Previous Next Index