Class Phrasebook

java.lang.Object
org.episteme.core.mathematics.loaders.openmath.phrasebook.Phrasebook

public abstract class Phrasebook extends 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.

Version:
$Version$
Author:
Manfred Riem (mriem@win.tue.nl)
  • Constructor Details

    • Phrasebook

      public Phrasebook()
      Constructor.

  • Method Details

    • perform

      public String perform(String fMethod, Vector<Object> 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 Object execute(String fMethod, Vector<Object> 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(String fName, String fLocation, 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(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.