ModuleContext (PMII - Principia Mathematica II)
Keywords: com.meyling.principia.module.ModuleContext class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Hilbert II - JAVA-Packages - Principia Mathematica II
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.meyling.principia.module
Class ModuleContext

    java.lang.Object
      com.meyling.principia.module.ModuleContext

public final class ModuleContext
extends Object

This class provides static access methods for loading modules.

Version:
  $Revision: 1.43 $
Author:
  Michael Meyling

Method Summary
`void` | `clearLocalBuffer()`
`boolean` | `compress(String address)` Remove double and unused lines of all propositions of a module and save modified back in local generated directory.
`List` | `getAllCheckedModules()`
`static String` | `getBufferDirectory()` Get buffer directory for qedeq module files.
`static String` | `getGenerationDirectory()` Get directory for generated files.
`static ModuleContext` | `getInstance()` Get instance of module context.
`static String` | `getKernelVersion()` Get version of this kernel.
`ModuleProperties` | `getModuleProperties(String address)`
`static String` | `getRuleVersion()` Get maximum version of supported rules.
`static String` | `getVersionDirectory()` Get relative version directory of this kernel.
`boolean` | `loadAllModulesFromQedeq()`
`Module` | `loadModule(ModuleAddress moduleAddress)` Get a certain module.
`Module` | `loadModule(Module module, Specification spec)` Load a certain module.
`Module` | `loadModule(String address)` Get a certain module.
`boolean` | `loadPreviouslyCheckedModules()`
`(package private) void` | `moduleCheckStarted(ModuleAddress moduleAddress)`
`void` | `reduceToBasicRules(String address)` Reduce module file to module file that uses only basic rules.
`void` | `removeAllModules()` Remove all modules from memory.
`void` | `removeModuleAndDependents(ModuleProperties prop)` Remove a module and its dependents from memory.
`static void` | `setup()` Set dummy listener for this context.
`static void` | `setup(ModuleEventListener listener)` Set listener for this context.
`void` | `start()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getInstance

    public static final ModuleContext getInstance()
                                           throws IllegalStateException

  Get instance of module context. Method `setup(com.meyling.principia.module.ModuleEventListener)` must have been called before.

  Returns:
    singleton, which represents the module context
  Throws:
    `IllegalStateException` - `setup(com.meyling.principia.module.ModuleEventListener)` wasn't called before this method call

### setup

    public static final void setup(ModuleEventListener listener)
                            throws IOException

  Set listener for this context. Must be called at first. Couldn't be called again.

  Parameters:
    `listener` - this object listens to module events
  Throws:
    `IllegalStateException` - `setup(com.meyling.principia.module.ModuleEventListener)` was called once before or `Config#setup` was not configured properly
    `IOException` - directory entries were no valid file names

### start

    public final void start()

### setup

    public static final void setup()
                            throws IllegalStateException,
                                   IOException

  Set dummy listener for this context. Must be called at first. Shouldn't be called again.

  Throws:
    `IllegalStateException` - `setup(com.meyling.principia.module.ModuleEventListener)` was called once before or `Config#setup` was not configured properly
    `IOException` - directory entries were no valid file names

### removeAllModules

    public final void removeAllModules()

  Remove all modules from memory.

### removeModuleAndDependents

    public final void removeModuleAndDependents(ModuleProperties prop)

  Remove a module and its dependents from memory.

### clearLocalBuffer

    public final void clearLocalBuffer()
                                throws IOException

  Throws:
    `IOException`

### getRuleVersion

    public static final String getRuleVersion()

  Get maximum version of supported rules.

  Returns:
    rule version

### getKernelVersion

    public static final String getKernelVersion()

  Get version of this kernel.

  Returns:
    kernel version

### getVersionDirectory

    public static final String getVersionDirectory()

  Get relative version directory of this kernel.

  Returns:
    version subdirectory

### compress

    public final boolean compress(String address)
                           throws IOException,
                                  ParsingException

  Remove double and unused lines of all propositions of a module and save modified back in local generated directory. The module in module cache is not modified.

  Parameters:
    `address` - address of module.
  Throws:
    `IOException` - module file couldn't be read or written
    `ParsingException` - TODO

### reduceToBasicRules

    public final void reduceToBasicRules(String address)
                                  throws IOException,
                                         ParsingException

  Reduce module file to module file that uses only basic rules. (Basic rules have the rule version "1.00.00".) The resulting file will be saved at the same directory in the file buffer where the original resides.

  Parameters:
    `address` - address of module
  Throws:
    `IOException` - if writing the resulting file is not possible (e.g. because there is already a module file of that name)
    `ParsingException` - if there were a parsing problem for the referenced (or one indirectly connected) module
    `IllegalArgumentException` - if something unexpected happens (e.g. a programming error occurs)

### loadModule

    public final Module loadModule(String address)
                            throws ParsingException,
                                   IOException

  Get a certain module.

  Parameters:
    `address` - address of module
  Returns:
    wanted module
  Throws:
    `IOException` - if loading was not successfull
    `ParsingException` - if loading the module lead to an parsing error

### loadModule

    public final Module loadModule(ModuleAddress moduleAddress)
                            throws ParsingException,
                                   IOException

  Get a certain module.

  Returns:
    wanted module
  Throws:
    `IOException` - if loading was not successfull
    `ParsingException` - if loading the module lead to an parsing error

### loadModule

    public final Module loadModule(Module module,
                                   Specification spec)
                            throws ArgumentException,
                                   ParsingException

  Load a certain module.

  Parameters:
    `module` - this is the current module.
    `spec` - specification of wanted module.
  Returns:
    wanted module
  Throws:
    `ArgumentException` - loading was not successfull.
    `ParsingException` - loading another module lead to an parsing error.
    `IOException` - `spec` didn't lead to a valid module address

### moduleCheckStarted

    final void moduleCheckStarted(ModuleAddress moduleAddress)

### getAllCheckedModules

    public final List getAllCheckedModules()

### loadPreviouslyCheckedModules

    public final boolean loadPreviouslyCheckedModules()

### loadAllModulesFromQedeq

    public final boolean loadAllModulesFromQedeq()

### getBufferDirectory

    public static String getBufferDirectory()

  Get buffer directory for qedeq module files.

  Returns:
    buffer directory.

### getGenerationDirectory

    public static final String getGenerationDirectory()

  Get directory for generated files.

  Returns:
    generation directory

### getModuleProperties

    public final ModuleProperties getModuleProperties(String address)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Hilbert II - JAVA-Packages - Principia Mathematica II
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

©left GNU General Public Licence All Rights Reserved.