Debian Codegraph @

Source/Reasoner/Preprocess/CNominalSchemaAbsorptionPathLinker.cpp

raw
1 /*
2 * Copyright (C) 2013-2015, 2019 by the Konclude Developer Team.
3 *
4 * This file is part of the reasoning system Konclude.
5 * For details and support, see <http://konclude.com/>.
6 *
7 * Konclude is free software: you can redistribute it and/or modify
8 * it under the terms of version 3 of the GNU Lesser General Public
9 * License (LGPLv3) as published by the Free Software Foundation.
10 *
11 * Konclude is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU (Lesser) General Public License for more details.
15 *
16 * You should have received a copy of the GNU (Lesser) General Public
17 * License along with Konclude. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21 #include "CNominalSchemaAbsorptionPathLinker.h"
22
23
24 namespace Konclude {
25
26 namespace Reasoner {
27
28 namespace Preprocess {
29
30
31 CNominalSchemaAbsorptionPathLinker::CNominalSchemaAbsorptionPathLinker() : CLinkerBase<CNominalSchemaAbsorptionPathLinker*,CNominalSchemaAbsorptionPathLinker>(this) {
32 }
33
34 CNominalSchemaAbsorptionPathLinker* CNominalSchemaAbsorptionPathLinker::initNominalSchemaAbsorptionPathLinker(CNominalSchemaAbsorptionPathLinker* nomSchAbsorpPathLinker) {
35 if (nomSchAbsorpPathLinker) {
36 mNomSchBindConceptHash = nomSchAbsorpPathLinker->mNomSchBindConceptHash;
37 mAncestorList = nomSchAbsorpPathLinker->mAncestorList;
38 mVariableList = nomSchAbsorpPathLinker->mVariableList;
39 mLastPathConcept = nomSchAbsorpPathLinker->mLastPathConcept;
40 } else {
41 mLastPathConcept = nullptr;
42 mNomSchBindConceptHash.clear();
43 mAncestorList.clear();
44 mVariableList.clear();
45 }
46 return this;
47 }
48
49 QHash<CConcept*,CConcept*>* CNominalSchemaAbsorptionPathLinker::getNominalSchemaBindedConceptTriggerHash() {
50 return &mNomSchBindConceptHash;
51 }
52
53 QList<CConcept*>* CNominalSchemaAbsorptionPathLinker::getAncestorConceptTriggerList() {
54 return &mAncestorList;
55 }
56
57 QList<CVariable*>* CNominalSchemaAbsorptionPathLinker::getVariableList() {
58 return &mVariableList;
59 }
60
61 bool CNominalSchemaAbsorptionPathLinker::hasVariables() {
62 return !mVariableList.isEmpty();
63 }
64
65 CNominalSchemaAbsorptionPathLinker* CNominalSchemaAbsorptionPathLinker::addVariable(CVariable* variable) {
66 mVariableList.append(variable);
67 return this;
68 }
69
70
71 CVariable* CNominalSchemaAbsorptionPathLinker::getLastVariable() {
72 if (hasVariables()) {
73 return mVariableList.last();
74 } else {
75 return nullptr;
76 }
77 }
78
79 CConcept* CNominalSchemaAbsorptionPathLinker::getLastPathTriggerConcept() {
80 return mLastPathConcept;
81 }
82
83 CNominalSchemaAbsorptionPathLinker* CNominalSchemaAbsorptionPathLinker::setLastPathTriggerConcept(CConcept* lastPathTriggerConcept) {
84 mLastPathConcept = lastPathTriggerConcept;
85 return this;
86 }
87
88 }; // end namespace Preprocess
89
90 }; // end namespace Reasoner
91
92 }; // end namespace Konclude