EverythingExists.java
01 /* This file is part of the project "Hilbert II" - http://www.qedeq.org
02  *
03  * Copyright 2000-2011,  Michael Meyling <mime@qedeq.org>.
04  *
05  * "Hilbert II" is free software; you can redistribute
06  * it and/or modify it under the terms of the GNU General Public
07  * License as published by the Free Software Foundation; either
08  * version 2 of the License, or (at your option) any later version.
09  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  */
15 
16 package org.qedeq.kernel.bo.logic.wf;
17 
18 import org.qedeq.kernel.bo.logic.common.ExistenceChecker;
19 import org.qedeq.kernel.bo.logic.common.FunctionKey;
20 import org.qedeq.kernel.bo.logic.common.PredicateKey;
21 
22 
23 /**
24  * This implementation gives always the answer <code>true</code> to the question
25  <em>exists this predicate?</em>.
26  *
27  @author  Michael Meyling
28  */
29 public final class EverythingExists implements ExistenceChecker {
30 
31     /** One and only instance. */
32     private static final ExistenceChecker ALWAYS = new EverythingExists();
33 
34     /**
35      * Hidden constructor.
36      */
37     private EverythingExists() {
38         // nothing to do
39     }
40 
41     public boolean predicateExists(final String name, final int arguments) {
42         return true;
43     }
44 
45     public boolean predicateExists(final PredicateKey predicate) {
46         return true;
47     }
48 
49     public boolean isInitialPredicate(final PredicateKey predicate) {
50         return true;
51     }
52 
53     public boolean functionExists(final String name, final int arguments) {
54         return true;
55     }
56 
57     public boolean functionExists(final FunctionKey function) {
58         return true;
59     }
60 
61     public boolean isInitialFunction(final FunctionKey predicate) {
62         return true;
63     }
64 
65     public boolean classOperatorExists() {
66         return true;
67     }
68 
69     public boolean identityOperatorExists() {
70         return true;
71     }
72 
73     public String getIdentityOperator() {
74         return NAME_EQUAL;
75     }
76 
77     /**
78      * Get one instance of this class.
79      *
80      @return  Class instance.
81      */
82     public static final ExistenceChecker getInstance() {
83         return ALWAYS;
84     }
85 
86 }