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


Constructor Index

 o JIPEngine(Frame, String, DataInputStream, PrintStream)
Constructor

Method Index

 o addErrorListener(JIPErrorListener)
Add an ErrorListener
 o addEventListener(JIPEventListener)
Add an EventListener
 o addTraceListener(JIPTraceListener)
add a TraceListener
 o closeAllQueries()
Close all pending queries
 o closeQuery(int)
Close the query.
 o consultFile(String)
Consult a file from a file
 o consultInputStream()
Consult a file from the input stream
 o consultStream(DataInputStream)
Consult a stream
 o finalize()
Release the resources used by JIP
 o getBasePath()
Get the base path
 o getErrorListeners()
Get the list of ErrorListeners
 o getEventListeners()
Get the list of EventListeners
 o getInputStream()
Get InputStream
 o getMainFrame()
 o getOutputStream()
Get OutputStream
 o getTraceListeners()
Get the list of TraceListener
 o getVersion()
Version Return the jiprolog API version
 o moreSolutions(int)
Check if there is one more solution
 o nextSolution(int)
Search for another soution.
 o openQuery(JIPTerm)
Open a query.
 o openQuery(String)
Open a query.
 o reset()
Close all pending queries, reset the prolog interpreter and clear the database
 o setBasePath(String)
Set the base path of the engine
 o setInputStream(DataInputStream)
Set InputStream
 o setMainFrame(Frame)
Set the Main Frame of the interpreter
 o setOutputStream(PrintStream)
Set OutputStream
 o setTrace(boolean)
Set trace flag
 o update(int, Object)

Constructors

 o 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

Methods

 o getVersion
 public static String getVersion()
Version Return the jiprolog API version

 o addEventListener
 public void addEventListener(JIPEventListener listener)
Add an EventListener

Parameters:
listener - EventListener to add
See Also:
JIPEventListener
 o getEventListeners
 public Vector getEventListeners()
Get the list of EventListeners

See Also:
JIPEventListener
 o addErrorListener
 public void addErrorListener(JIPErrorListener listener)
Add an ErrorListener

Parameters:
listener - ErrorListener to add
See Also:
JIPErrorListener
 o getErrorListeners
 public Vector getErrorListeners()
Get the list of ErrorListeners

See Also:
JIPErrorListener
 o addTraceListener
 public void addTraceListener(JIPTraceListener traceListener)
add a TraceListener

Parameters:
listener - TraceEventListener to set
See Also:
JIPTraceEventListener
 o getTraceListeners
 public Vector getTraceListeners()
Get the list of TraceListener

See Also:
JIPTraceListener
 o 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
 o setBasePath
 public void setBasePath(String strPath)
Set the base path of the engine

Parameters:
strPath - Base path
 o getBasePath
 public String getBasePath()
Get the base path

Returns:
the base path of the engine
 o setTrace
 public void setTrace(boolean bTrace)
Set trace flag

Parameters:
bTrace - Trace flag
 o setOutputStream
 public void setOutputStream(PrintStream outs)
Set OutputStream

Parameters:
outs - PrintStream
 o getOutputStream
 public PrintStream getOutputStream()
Get OutputStream

 o getInputStream
 public DataInputStream getInputStream()
Get InputStream

 o setInputStream
 public void setInputStream(DataInputStream ins)
Set InputStream

Parameters:
ins - DataInputStream
 o reset
 public void reset()
Close all pending queries, reset the prolog interpreter and clear the database

 o consultInputStream
 public boolean consultInputStream()
Consult a file from the input stream

 o consultStream
 public boolean consultStream(DataInputStream ins)
Consult a stream

 o consultFile
 public boolean consultFile(String strFilePath)
Consult a file from a file

 o 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
 o 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
 o 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
 o 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
 o moreSolutions
 public synchronized boolean moreSolutions(int nQueryHandle)
Check if there is one more solution

Parameters:
nQueryHandle - the handle of the query
 o closeAllQueries
 public synchronized void closeAllQueries()
Close all pending queries

 o update
 public final synchronized void update(int nQueryHandle,
                                       Object obj)
 o getMainFrame
 public Frame getMainFrame()
 o finalize
 public void finalize()
Release the resources used by JIP

Overrides:
finalize in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index