se.sics.jasper
Class PrologEngine

java.lang.Object
  extended by se.sics.jasper.PrologEngine

Deprecated. Only intended as an example Objects of this class represent a Prolog engine running in a separate process.

public class PrologEngine
extends java.lang.Object

This code is unsupported and unfinished. It is provided "as is" for demontration purposes only. The supported interface between Java and SICStus is the SICStus class and related classes.

See Also:
SICStus

Constructor Summary
PrologEngine(java.lang.String[] cmdarray)
          Deprecated. Starts a new Prolog process on the local machine
PrologEngine(java.lang.String machine, int portNum)
          Deprecated. Connect to a running Prolog process on 'machine:portNum'.
 
Method Summary
static int cbTestMethod(int x, double y)
          Deprecated.  
static java.lang.Object cbTestMethod(java.lang.Integer obj, int x, double y)
          Deprecated.  
 boolean compile(java.lang.String filename)
          Deprecated. Instruct the Prolog engine to compile a file.
 boolean consult(java.lang.String filename)
          Deprecated. Instruct the Prolog engine to consult a file.
protected  void finalize()
          Deprecated.  
static java.lang.String getNextLine(java.io.BufferedReader reader)
          Deprecated. Returns next non-empty line from 'reader' which does not start with '#'.
 void halt()
          Deprecated.  
static void main(java.lang.String[] argv)
          Deprecated.  
 boolean query(java.lang.Object[] querySpec)
          Deprecated. Ask a Prolog query given an array of Java objects.
 boolean query(java.lang.String query)
          Deprecated. Ask a query to the Prolog engine
 boolean restore(java.lang.String filename)
          Deprecated. Instruct the Prolog engine to restore a saved state.
static void writeLine(java.io.BufferedWriter writer, java.lang.String str)
          Deprecated. Writes a string to a BufferedWriter, adds a newline and flushes the stream
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrologEngine

public PrologEngine(java.lang.String[] cmdarray)
             throws java.io.IOException,
                    ConnectionFailedException,
                    PrologException
Deprecated. 
Starts a new Prolog process on the local machine

Throws:
java.io.IOException
ConnectionFailedException
PrologException

PrologEngine

public PrologEngine(java.lang.String machine,
                    int portNum)
             throws java.io.IOException,
                    ConnectionFailedException,
                    PrologException
Deprecated. 
Connect to a running Prolog process on 'machine:portNum'.

Throws:
java.io.IOException
ConnectionFailedException
PrologException
Method Detail

cbTestMethod

public static int cbTestMethod(int x,
                               double y)
Deprecated. 

cbTestMethod

public static java.lang.Object cbTestMethod(java.lang.Integer obj,
                                            int x,
                                            double y)
Deprecated. 

getNextLine

public static java.lang.String getNextLine(java.io.BufferedReader reader)
                                    throws java.io.IOException
Deprecated. 
Returns next non-empty line from 'reader' which does not start with '#'. Returns null on EOF.

Throws:
java.io.IOException

writeLine

public static void writeLine(java.io.BufferedWriter writer,
                             java.lang.String str)
                      throws java.io.IOException
Deprecated. 
Writes a string to a BufferedWriter, adds a newline and flushes the stream

Throws:
java.io.IOException

finalize

protected void finalize()
                 throws java.io.IOException,
                        java.lang.InterruptedException
Deprecated. 
Overrides:
finalize in class java.lang.Object
Throws:
java.io.IOException
java.lang.InterruptedException

halt

public void halt()
          throws java.io.IOException,
                 java.lang.InterruptedException
Deprecated. 
Throws:
java.io.IOException
java.lang.InterruptedException

query

public boolean query(java.lang.String query)
              throws java.io.IOException,
                     PrologException
Deprecated. 
Ask a query to the Prolog engine

Throws:
java.io.IOException
PrologException

query

public boolean query(java.lang.Object[] querySpec)
              throws java.io.IOException,
                     PrologException
Deprecated. 
Ask a Prolog query given an array of Java objects. This method is used if you need to send (references to) Java objects to Prolog.

Throws:
java.io.IOException
PrologException

consult

public boolean consult(java.lang.String filename)
                throws java.io.IOException,
                       PrologException
Deprecated. 
Instruct the Prolog engine to consult a file. This will cause the Prolog engine to perform the query "['']."

Throws:
java.io.IOException
PrologException

compile

public boolean compile(java.lang.String filename)
                throws java.io.IOException,
                       PrologException
Deprecated. 
Instruct the Prolog engine to compile a file. This will cause the Prolog engine to perform the query "compile('')."

Throws:
java.io.IOException
PrologException

restore

public boolean restore(java.lang.String filename)
                throws java.io.IOException,
                       PrologException
Deprecated. 
Instruct the Prolog engine to restore a saved state. This will cause the Prolog engine to perform the query "restore('')."

Throws:
java.io.IOException
PrologException

main

public static void main(java.lang.String[] argv)
Deprecated.