Hilbert II - Version 0.03.08

org.qedeq.kernel.bo.logic
Class DefaultExistenceChecker

java.lang.Object
  extended byorg.qedeq.kernel.bo.logic.DefaultExistenceChecker
All Implemented Interfaces:
ClassOperatorExistenceChecker, EqualityOperatorExistenceChecker, ExistenceChecker, FunctionExistenceChecker, PredicateExistenceChecker
Direct Known Subclasses:
ModuleConstantsExistenceChecker

public class DefaultExistenceChecker
extends Object
implements ExistenceChecker

Checks if all predicate and function constants exist already.

Version:
$Revision: 1.1 $

Field Summary
 
Fields inherited from interface org.qedeq.kernel.bo.logic.ExistenceChecker
NAME_EQUAL
 
Constructor Summary
DefaultExistenceChecker()
          Constructor.
 
Method Summary
 void add(FunctionDefinition definition)
          Add unknown function constant definition.
 void add(PredicateDefinition definition)
          Add unknown predicate constant definition.
 boolean classOperatorExists()
          Check if the class operator is already defined.
 void clear()
          Empty all definitions.
 boolean equalityOperatorExists()
          Check if the equality operator is already defined.
 boolean functionExists(Function function)
          Check if a function constant is already defined.
 boolean functionExists(String name, int arguments)
          Check if a function is already defined.
 FunctionDefinition get(Function function)
          Get function constant definition.
 PredicateDefinition get(Predicate predicate)
          Get predicate constant definition.
 FunctionDefinition getFunction(String name, int arguments)
          Get function constant definition.
 String getIdentityOperator()
          Get equality operator.
 PredicateDefinition getPredicate(String name, int arguments)
          Get predicate constant definition.
 boolean predicateExists(Predicate predicate)
          Check if a predicate constant is already defined.
 boolean predicateExists(String name, int arguments)
          Check if a predicate is already defined.
 void setClassOperatorExists(boolean existence)
          Set if the class operator is already defined.
 void setIdentityOperatorDefined(boolean defined, String identityOperator)
          Set the identity operator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultExistenceChecker

public DefaultExistenceChecker()
Constructor.

Method Detail

clear

public void clear()
Empty all definitions.


predicateExists

public boolean predicateExists(Predicate predicate)
Check if a predicate constant is already defined.

Specified by:
predicateExists in interface PredicateExistenceChecker
Parameters:
predicate - Predicate.
Returns:
Predicate is already defined.

predicateExists

public boolean predicateExists(String name,
                               int arguments)
Description copied from interface: PredicateExistenceChecker
Check if a predicate is already defined.

Specified by:
predicateExists in interface PredicateExistenceChecker
Parameters:
name - Predicate name.
arguments - Number of operands for the predicate.
Returns:
Predicate is defined.

add

public void add(PredicateDefinition definition)
Add unknown predicate constant definition. If the predicate constant is already known a runtime exception is thrown.

Parameters:
definition - Predicate constant definition that is not already known. Must not be null.
Throws:
IllegalArgumentException - Predicate constant is already defined.

get

public PredicateDefinition get(Predicate predicate)
Get predicate constant definition.

Parameters:
predicate - Get definition of this predicate.
Returns:
Definition.

getPredicate

public PredicateDefinition getPredicate(String name,
                                        int arguments)
Get predicate constant definition.

Parameters:
name - Name of predicate.
arguments - Arguments of predicate.
Returns:
Definition.

functionExists

public boolean functionExists(Function function)
Check if a function constant is already defined.

Specified by:
functionExists in interface FunctionExistenceChecker
Parameters:
function - Function.
Returns:
Function is already defined.

functionExists

public boolean functionExists(String name,
                              int arguments)
Description copied from interface: FunctionExistenceChecker
Check if a function is already defined.

Specified by:
functionExists in interface FunctionExistenceChecker
Parameters:
name - Function name.
arguments - Number of operands for the function.
Returns:
Functions is defined.

add

public void add(FunctionDefinition definition)
Add unknown function constant definition. If the function constant is already known a runtime exception is thrown.

Parameters:
definition - Function constant definition that is not already known. Must not be null.
Throws:
IllegalArgumentException - Function constant is already defined.

get

public FunctionDefinition get(Function function)
Get function constant definition.

Parameters:
function - Get definition of this predicate.
Returns:
Definition.

getFunction

public FunctionDefinition getFunction(String name,
                                      int arguments)
Get function constant definition.

Parameters:
name - Name of function.
arguments - Arguments of function.
Returns:
Definition.

classOperatorExists

public boolean classOperatorExists()
Description copied from interface: ClassOperatorExistenceChecker
Check if the class operator is already defined.

Specified by:
classOperatorExists in interface ClassOperatorExistenceChecker
Returns:
Class operator is defined.

setClassOperatorExists

public void setClassOperatorExists(boolean existence)
Set if the class operator is already defined.

Parameters:
existence - Class operator is defined.

equalityOperatorExists

public boolean equalityOperatorExists()
Description copied from interface: EqualityOperatorExistenceChecker
Check if the equality operator is already defined.

Specified by:
equalityOperatorExists in interface EqualityOperatorExistenceChecker
Returns:
Equality operator is already defined.

setIdentityOperatorDefined

public void setIdentityOperatorDefined(boolean defined,
                                       String identityOperator)
Set the identity operator.

Parameters:
defined - Is the operator defined?
identityOperator - Operator name.

getIdentityOperator

public String getIdentityOperator()
Description copied from interface: EqualityOperatorExistenceChecker
Get equality operator. This is the operator string of a predicate.

Specified by:
getIdentityOperator in interface EqualityOperatorExistenceChecker
Returns:
Equality operator. Should be null if !EqualityOperatorExistenceChecker.equalityOperatorExists().

Hilbert II - Version 0.03.08

©left GNU General Public Licence
All Rights Reserved.