Hilbert II - Version 0.03.09

org.qedeq.kernel.bo.control
Class KernelQedeqBo

java.lang.Object
  extended byorg.qedeq.kernel.bo.control.KernelQedeqBo
All Implemented Interfaces:
QedeqBo

public class KernelQedeqBo
extends Object
implements QedeqBo

Represents a module and its states. This is a kernel intern representation.

Version:
$Revision: 1.1 $

Constructor Summary
(package private) KernelQedeqBo(ModuleAddress address)
          Creates new module properties.
 
Method Summary
 SourceArea createSourceArea(Qedeq qedeq, ModuleContext context)
          Get area in XML source file for QEDEQ module context.
 SourceFileException createSourceFileException(ModuleDataException exception)
          Create exception out of ModuleDataException.
 SourceFileExceptionList createSourceFileExceptionList(ModuleDataException exception)
          Create exception out of ModuleDataException.
 SourceFileExceptionList createSourceFileExceptionList(ModuleDataException exception, Qedeq qedeq)
          Create exception out of ModuleDataException.
 void delete()
          Delete QEDEQ module.
 boolean equals(Object obj)
           
 DependencyState getDependencyState()
          Get module dependency state.
 KernelModuleReferenceList getDependentModules()
          Get labels and URLs of all directly dependent modules.
 String getEncoding()
          In what encoding the module was parsed.
 SourceFileExceptionList getException()
          Get exception.
 ExistenceChecker getExistenceChecker()
          Get the predicate and function existence checker.
 KernelModuleReferenceList getKernelRequiredModules()
          Get labels and URLs of all referenced modules.
 ModuleLabels getLabels()
          Get label references for QEDEQ module.
 ModuleLoader getLoader()
          Get loader used to load this object.
 int getLoadingCompleteness()
          Set completeness percentage.
 LoadingState getLoadingState()
          Get module loading state.
 LogicalState getLogicalState()
          Get module logical state.
 ModuleAddress getModuleAddress()
          Get ModuleAddress of module.
 String getName()
          Get name of module.
 Qedeq getQedeq()
          Get module.
 ModuleReferenceList getRequiredModules()
          Get labels and URLs of all referenced modules.
 String getRuleVersion()
          Get rule version information.
 String getStateDescription()
          Get module state description.
protected  StateManager getStateManager()
          Get StateManager.
 URL getUrl()
          Get original URL of module.
 SourceFileExceptionList getWarnings()
          Get warnings for this BO.
 boolean hasFailures()
          Is this a failure state the module is in?
 int hashCode()
           
 boolean hasLoadedRequiredModules()
          Are all required modules loaded?
 boolean isChecked()
          Was the module checked?
 boolean isLoaded()
          Is this module already loaded?
 void setChecked(ExistenceChecker checker)
          Set logic checked state.
 void setDependencyFailureState(DependencyState state, SourceFileExceptionList e)
          Set failure module state.
 void setDependencyProgressState(DependencyState state)
          Set dependency progress module state.
protected  void setDependencyState(DependencyState state)
          Set DependencyState.
 void setEncoding(String encoding)
          Set character encoding for this module.
protected  void setException(SourceFileExceptionList exception)
          Set SourceFileExceptionList.
protected  void setExistenceChecker(ExistenceChecker checker)
          Set ExistenceChecker.
 void setLabels(ModuleLabels labels)
          Set label references for QEDEQ module.
 void setLoaded(QedeqVo qedeq, ModuleLabels labels)
          Set loading state to "loaded".
 void setLoadedRequiredModules(KernelModuleReferenceList list)
          Set loaded required requirements state.
 void setLoader(ModuleLoader loader)
          Set loader used for loading this object.
 void setLoadingCompleteness(int completeness)
          Set completeness percentage.
 void setLoadingFailureState(LoadingState state, SourceFileExceptionList e)
          Set failure module state.
 void setLoadingProgressState(LoadingState state)
          Set loading progress module state.
protected  void setLoadingState(LoadingState state)
          Set LoadingState.
 void setLogicalFailureState(LogicalState state, SourceFileExceptionList e)
          Set failure module state.
 void setLogicalProgressState(LogicalState state)
          Set loading progress module state.
protected  void setLogicalState(LogicalState state)
          Set LogicalState.
protected  void setQedeqVo(QedeqVo qedeq)
          Set QedeqVo.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KernelQedeqBo

KernelQedeqBo(ModuleAddress address)
Creates new module properties.

Parameters:
address - Module address (not null).
Throws:
NullPointerException - address is null.
Method Detail

setLoader

public void setLoader(ModuleLoader loader)
Set loader used for loading this object.

Parameters:
loader -

getLoader

public ModuleLoader getLoader()
Get loader used to load this object.

Returns:
Loader.

hasFailures

public boolean hasFailures()
Description copied from interface: QedeqBo
Is this a failure state the module is in?

Specified by:
hasFailures in interface QedeqBo
Returns:
were there any errors?

getModuleAddress

public ModuleAddress getModuleAddress()
Description copied from interface: QedeqBo
Get ModuleAddress of module.

Specified by:
getModuleAddress in interface QedeqBo
Returns:
address of module.

setLoadingCompleteness

public void setLoadingCompleteness(int completeness)
Set completeness percentage. LATER manage per state handler?

Parameters:
completeness - Completeness of loading into memory.

getLoadingCompleteness

public int getLoadingCompleteness()
Description copied from interface: QedeqBo
Set completeness percentage.

Specified by:
getLoadingCompleteness in interface QedeqBo
Returns:
completeness Completeness of loading into memory in percent.

delete

public void delete()
Delete QEDEQ module. Invalidates all dependent modules.


setLoadingProgressState

public void setLoadingProgressState(LoadingState state)
Set loading progress module state.

Parameters:
state - Module loading state. Must not be null.
Throws:
IllegalStateException - State is a failure state or module loaded state.

setLoadingFailureState

public void setLoadingFailureState(LoadingState state,
                                   SourceFileExceptionList e)
Set failure module state.

Parameters:
state - Module loading state. Must not be null.
e - Exception that occurred during loading. Must not be null.
Throws:
IllegalArgumentException - state is no failure state

getLoadingState

public LoadingState getLoadingState()
Description copied from interface: QedeqBo
Get module loading state.

Specified by:
getLoadingState in interface QedeqBo
Returns:
module state.

isLoaded

public boolean isLoaded()
Description copied from interface: QedeqBo
Is this module already loaded?

Specified by:
isLoaded in interface QedeqBo
Returns:
Is this module already loaded?

setLoaded

public void setLoaded(QedeqVo qedeq,
                      ModuleLabels labels)
Set loading state to "loaded". Also puts null to getLabels().

Parameters:
qedeq - This module was loaded. Must not be null.
labels - Module labels.
Throws:
NullPointerException - One argument was null.

getEncoding

public String getEncoding()
Description copied from interface: QedeqBo
In what encoding the module was parsed.

Specified by:
getEncoding in interface QedeqBo
Returns:
Encoding.

setEncoding

public void setEncoding(String encoding)
Set character encoding for this module. Can be null.

Parameters:
encoding - Encoding.

getQedeq

public Qedeq getQedeq()
Description copied from interface: QedeqBo
Get module. Works only if module is already completely loaded.

Specified by:
getQedeq in interface QedeqBo
Returns:
QEDEQ module if it is already loaded.

setDependencyProgressState

public void setDependencyProgressState(DependencyState state)
Set dependency progress module state.

Parameters:
state - Module state. Must not be null.
Throws:
IllegalStateException - Module is not yet loaded.
IllegalArgumentException - state is failure state or loaded required state.
NullPointerException - state is null.

setDependencyFailureState

public void setDependencyFailureState(DependencyState state,
                                      SourceFileExceptionList e)
Set failure module state.

Parameters:
state - Module dependency state. Must not be null.
e - Exception that occurred during loading. Must not be null.
Throws:
IllegalStateException - Module is not yet loaded.
IllegalArgumentException - state is no failure state.
NullPointerException - state is null.

getDependencyState

public DependencyState getDependencyState()
Description copied from interface: QedeqBo
Get module dependency state.

Specified by:
getDependencyState in interface QedeqBo
Returns:
module state.

setLoadedRequiredModules

public void setLoadedRequiredModules(KernelModuleReferenceList list)
Set loaded required requirements state.

Parameters:
list - URLs of all referenced modules. Must not be null.
Throws:
IllegalStateException - Module is not yet loaded.

getRequiredModules

public ModuleReferenceList getRequiredModules()
Description copied from interface: QedeqBo
Get labels and URLs of all referenced modules. Only available if module has loaded all required modules. Otherwise a runtime exception is thrown.

Specified by:
getRequiredModules in interface QedeqBo
Returns:
URLs of all referenced modules.

getKernelRequiredModules

public KernelModuleReferenceList getKernelRequiredModules()
Get labels and URLs of all referenced modules.

Returns:
URLs of all referenced modules.

hasLoadedRequiredModules

public boolean hasLoadedRequiredModules()
Description copied from interface: QedeqBo
Are all required modules loaded?

Specified by:
hasLoadedRequiredModules in interface QedeqBo
Returns:
Are all required modules loaded?

getDependentModules

public KernelModuleReferenceList getDependentModules()
Get labels and URLs of all directly dependent modules.

Returns:
URLs of all referenced modules.

setChecked

public void setChecked(ExistenceChecker checker)
Set logic checked state. Also set the predicate and function existence checker.

Parameters:
checker - Checks if a predicate or function constant is defined.

getExistenceChecker

public ExistenceChecker getExistenceChecker()
Get the predicate and function existence checker. Is only not null if logic was successfully checked.

Returns:
Checker. Checks if a predicate or function constant is defined.

isChecked

public boolean isChecked()
Description copied from interface: QedeqBo
Was the module checked?

Specified by:
isChecked in interface QedeqBo
Returns:
Module is checked?

setLogicalProgressState

public void setLogicalProgressState(LogicalState state)
Set loading progress module state. Must not be null.

Parameters:
state - module state

setLogicalFailureState

public void setLogicalFailureState(LogicalState state,
                                   SourceFileExceptionList e)
Set failure module state.

Parameters:
state - module state
e - Exception that occurred during loading.
Throws:
IllegalArgumentException - state is no failure state

getLogicalState

public LogicalState getLogicalState()
Description copied from interface: QedeqBo
Get module logical state.

Specified by:
getLogicalState in interface QedeqBo
Returns:
module state.

getException

public SourceFileExceptionList getException()
Description copied from interface: QedeqBo
Get exception.

Specified by:
getException in interface QedeqBo
Returns:
exception.

getWarnings

public SourceFileExceptionList getWarnings()
Get warnings for this BO.

FIXME mime 20080324: implement this method. Put in interface and use in GUI.

Returns:
Warnings for this BO.

getStateDescription

public String getStateDescription()
Description copied from interface: QedeqBo
Get module state description.

Specified by:
getStateDescription in interface QedeqBo
Returns:
module state description.

getName

public String getName()
Description copied from interface: QedeqBo
Get name of module.

Specified by:
getName in interface QedeqBo
Returns:
module name.

getRuleVersion

public String getRuleVersion()
Description copied from interface: QedeqBo
Get rule version information.

Specified by:
getRuleVersion in interface QedeqBo
Returns:
rule version.

getUrl

public URL getUrl()
Description copied from interface: QedeqBo
Get original URL of module.

Specified by:
getUrl in interface QedeqBo
Returns:
URL of module.

setLabels

public void setLabels(ModuleLabels labels)
Set label references for QEDEQ module.

Parameters:
labels - Label references.

getLabels

public ModuleLabels getLabels()
Get label references for QEDEQ module.

Returns:
Label references.

createSourceFileExceptionList

public SourceFileExceptionList createSourceFileExceptionList(ModuleDataException exception)
Create exception out of ModuleDataException.

Parameters:
exception - Take this exception.
Returns:
Newly created instance.

createSourceFileExceptionList

public SourceFileExceptionList createSourceFileExceptionList(ModuleDataException exception,
                                                             Qedeq qedeq)
Create exception out of ModuleDataException.

Parameters:
exception - Take this exception.
qedeq - Take this QEDEQ source. (This might not be accessible via getQedeq().
Returns:
Newly created instance.

createSourceFileException

public SourceFileException createSourceFileException(ModuleDataException exception)
Create exception out of ModuleDataException.

Parameters:
exception - Take this exception.
Returns:
Newly created instance.

createSourceArea

public SourceArea createSourceArea(Qedeq qedeq,
                                   ModuleContext context)
Get area in XML source file for QEDEQ module context.

Parameters:
qedeq - Look at this QEDEQ module.
context - Search for this context.
Returns:
Created file area. Maybe null.

setQedeqVo

protected void setQedeqVo(QedeqVo qedeq)
Set QedeqVo. Doesn't do any status handling. Only for internal use.

Parameters:
qedeq - Set this value.

setLoadingState

protected void setLoadingState(LoadingState state)
Set LoadingState. Doesn't do any status handling. Only for internal use.

Parameters:
state - Set this loading state.

setDependencyState

protected void setDependencyState(DependencyState state)
Set DependencyState. Doesn't do any status handling. Only for internal use.

Parameters:
state - Set this dependency state.

setLogicalState

protected void setLogicalState(LogicalState state)
Set LogicalState. Doesn't do any status handling. Only for internal use.

Parameters:
state - Set this logical state.

setException

protected void setException(SourceFileExceptionList exception)
Set SourceFileExceptionList. Doesn't do any status handling. Only for internal use.

Parameters:
exception - Set this exception.

getStateManager

protected StateManager getStateManager()
Get StateManager. Only for internal use.

Returns:
StateManager

setExistenceChecker

protected void setExistenceChecker(ExistenceChecker checker)
Set ExistenceChecker. Doesn't do any status handling. Only for internal use.

Parameters:
checker - Set this checker.

hashCode

public int hashCode()

equals

public boolean equals(Object obj)

toString

public String toString()

Hilbert II - Version 0.03.09

©left GNU General Public Licence
All Rights Reserved.