org.jscience.ml.openmath.phrasebook
Class Phrasebook

java.lang.Object
  extended by org.jscience.ml.openmath.phrasebook.Phrasebook

public abstract class Phrasebook
extends java.lang.Object

Defines what a minimal phrasebook should implement.

Note that this class does NOT assume anything about the protocol used between client and server. This is the responsibility of the implementing subclass. Because of this, problems with the communication should be thrown as a subclass of PhrasebookException.


Constructor Summary
Phrasebook()
          Constructor.
 
Method Summary
 void addCD(java.lang.String fName, java.lang.String fLocation, java.lang.String fClassName)
          Adds a CD to the phrasebook.
 java.lang.Object execute(java.lang.String fMethod, java.util.Vector fArguments)
          An execute method.
 java.lang.String perform(java.lang.String fMethod, java.util.Vector fArguments)
          A perform method.
 void removeCD(java.lang.String fName)
          Removes a CD from the phrasebook.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Phrasebook

public Phrasebook()
Constructor.

Method Detail

perform

public java.lang.String perform(java.lang.String fMethod,
                                java.util.Vector fArguments)
                         throws PhrasebookException
A perform method.

Parameters:
fMethod - the type of perform.
fArguments - the arguments to the perform.
Returns:
the result.
Throws:
PhrasebookException - thrown when a major error occurs.

execute

public java.lang.Object execute(java.lang.String fMethod,
                                java.util.Vector fArguments)
                         throws PhrasebookException
An execute method.

Note: the previous version of the library (1.2) didn't allow you to return any object as a result of a perform. To make it possible this method is the right one to implement.

Parameters:
fMethod - the type of execution.
fArguments - the arguments to the execute.
Returns:
the result.
Throws:
PhrasebookException - thrown when a major error occurs.

addCD

public void addCD(java.lang.String fName,
                  java.lang.String fLocation,
                  java.lang.String fClassName)
           throws PhrasebookException
Adds a CD to the phrasebook.

Parameters:
fName - the name of the CD.
fLocation - the URL of the CD, if none is given it is assumed to be on the classpath
fClassName - the Codec of the CD.
Throws:
PhrasebookException - thrown when a major error occurs.

removeCD

public void removeCD(java.lang.String fName)
              throws PhrasebookException
Removes a CD from the phrasebook.

Parameters:
fName - the name of the CD.
Throws:
PhrasebookException - thrown when a major error occurs.