PMII - JAVA-Packages - Principia Mathematica II

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.13 $
Author:
Michael Meyling

Constructor Summary
ModuleContext()
           
 
Method Summary
(package private) static void ()
          Make attribut initialization.
static boolean compress(String address)
          Remove double and unused lines of all propositions of a module and save modified local buffer back.
static String getKernelVersion()
          Get version of this kernel.
static String getRuleVersion()
          Get maximum version of supported rules.
static Module loadLocalModule(ModuleAddress moduleAddress)
          Load a module.
static Module loadModule(ModuleAddress moduleAddress)
          Get a certain module.
static Module loadModule(Module module, Specification spec)
          Load a certain module.
static Module loadModule(String address)
          Get a certain module.
static void log(int level, Object object)
          Log message object with certain level to System.out: 1 = elementary events, 2 = more events.
static boolean reduceToBasicRules(String address)
          Reduce module file to module file that uses only basic rules.
static void setLogLevel(int level)
          Set logging level: 0 = no logging, 1 = elementary events, 2 = more events
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleContext

public ModuleContext()
Method Detail

static void ()
Make attribut initialization.

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

compress

public static final boolean compress(String address)
                              throws IOException,
                                     ParsingException
Remove double and unused lines of all propositions of a module and save modified local buffer back. The module in module cache is not modified.
Parameters:
address - address of module
Throws:
IOException - if module file couldn't be read or written
ParsingException - if

reduceToBasicRules

public static final boolean 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 static 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 static final Module loadModule(ModuleAddress moduleAddress)
                               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 static 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 - if loading was not successfull
ParsingException - if loading another module lead to an parsing error

loadLocalModule

public static final Module loadLocalModule(ModuleAddress moduleAddress)
                                    throws com.meyling.principia.module.ModuleContext.ModuleFileNotFoundException,
                                           IOException,
                                           ParsingException
Load a module.
Parameters:
address - module address
Returns:
loaded module
Throws:
ModuleFileNotFoundException - if local file was not found
IOException - if loading failed
ParsingException - if loading the module lead to an parsing error

setLogLevel

public static final void setLogLevel(int level)
Set logging level: 0 = no logging, 1 = elementary events, 2 = more events
Parameters:
level - logging level

log

public static final void log(int level,
                             Object object)
Log message object with certain level to System.out: 1 = elementary events, 2 = more events. Logging only occurs if current logging level is set to value equal or below level. (See setLogLevel(int)).
Parameters:
level - logging level
object - this object will be logged

PMII - JAVA-Packages - Principia Mathematica II

©left GNU General Public Licence
All Rights Reserved.