repthy
Class PariProcess

Object
  extended byPariProcess

public class PariProcess
extends Object

Maintains a Pari process and provides send(java.lang.String) and receive() methods for communicating with it. It's hard-coded for Pari under Windows, in that it uses \r\n as the signal that a computation is finished.

Important: call destroy() when you're done to close Pari and release I/O resources.

Author:
Mark McConnell

Constructor Summary
PariProcess()
          Convenience method for Mark's laptop.
 
Method Summary
 void destroy()
          Call this when you're done to destroy the process and release I/O resources.
static void main(String[] args)
          Runs a simple test.
 String receive()
          Returns the result of the previous send(java.lang.String).
 void send(String s)
          Sends its argument to Pari, followed by a newline.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PariProcess

public PariProcess()
            throws PariNotFoundException
Convenience method for Mark's laptop.

Method Detail

send

public void send(String s)
          throws IOException
Sends its argument to Pari, followed by a newline. Sample usage: send("2+2"). You can end the line with semicolon to mean you don't want output, as long as there are no trailing comments or whitespace after the semicolon.

Throws:
IOException

receive

public String receive()
Returns the result of the previous send(java.lang.String). Don't use it if the previous send(java.lang.String) ended in a semicolon, so that you don't expect any output from it.


destroy

public void destroy()
Call this when you're done to destroy the process and release I/O resources.


main

public static void main(String[] args)
Runs a simple test.