Skip to content

Package: MutableAddAxiom

MutableAddAxiom

nameinstructionbranchcomplexitylinemethod
MutableAddAxiom(OWLOntology, OWLAxiom)
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
equals(Object)
M: 35 C: 0
0%
M: 10 C: 0
0%
M: 6 C: 0
0%
M: 8 C: 0
0%
M: 1 C: 0
0%
getOntology()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
hashCode()
M: 15 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
setOntology(OWLOntology)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (C) 2020 Czech Technical University in Prague
3: * <p>
4: * This program is free software: you can redistribute it and/or modify it under
5: * the terms of the GNU General Public License as published by the Free Software
6: * Foundation, either version 3 of the License, or (at your option) any
7: * later version.
8: * <p>
9: * This program is distributed in the hope that it will be useful, but WITHOUT
10: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12: * details. You should have received a copy of the GNU General Public License
13: * along with this program. If not, see <http://www.gnu.org/licenses/>.
14: */
15: package cz.cvut.kbss.ontodriver.owlapi.util;
16:
17: import org.semanticweb.owlapi.model.AddAxiom;
18: import org.semanticweb.owlapi.model.OWLAxiom;
19: import org.semanticweb.owlapi.model.OWLOntology;
20:
21: import javax.annotation.Nonnull;
22: import java.util.Objects;
23:
24: /**
25: * Add axiom wrapper which allows us to set ontology to which it is applied.
26: */
27: public class MutableAddAxiom extends AddAxiom implements MutableAxiomChange {
28:
29: private OWLOntology ontology;
30:
31: /**
32: * @param ont the ontology to which the change is to be applied
33: * @param axiom The added axiom
34: */
35: public MutableAddAxiom(OWLOntology ont, OWLAxiom axiom) {
36: super(ont, axiom);
37: this.ontology = ont;
38: }
39:
40: @Override
41: public void setOntology(OWLOntology ontology) {
42: this.ontology = ontology;
43: }
44:
45: @Nonnull
46: @Override
47: public OWLOntology getOntology() {
48: return ontology;
49: }
50:
51: @Override
52: public boolean equals(Object o) {
53:• if (this == o) {
54: return true;
55: }
56:• if (!(o instanceof MutableAddAxiom)) {
57: return false;
58: }
59:• if (!super.equals(o)) {
60: return false;
61: }
62: MutableAddAxiom that = (MutableAddAxiom) o;
63:• return Objects.equals(ontology, that.ontology) && Objects.equals(getAxiom(), that.getAxiom());
64: }
65:
66: @Override
67: public int hashCode() {
68: return Objects.hash(super.hashCode(), ontology);
69: }
70: }