Skip to content

Package: SimpleListDescriptorImpl

SimpleListDescriptorImpl

nameinstructionbranchcomplexitylinemethod
SimpleListDescriptorImpl(NamedResource, Assertion, Assertion)
M: 0 C: 11
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
equals(Object)
M: 25 C: 0
0%
M: 6 C: 0
0%
M: 4 C: 0
0%
M: 8 C: 0
0%
M: 1 C: 0
0%
getContext()
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getListOwner()
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getListProperty()
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getNextNode()
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
hashCode()
M: 0 C: 14
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
setContext(URI)
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
toString()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * Copyright (C) 2023 Czech Technical University in Prague
3: *
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: *
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.descriptor;
16:
17: import cz.cvut.kbss.ontodriver.model.Assertion;
18: import cz.cvut.kbss.ontodriver.model.NamedResource;
19:
20: import java.net.URI;
21:
22: /**
23: * Describes a simple sequence.
24: * <p>
25: * Simple lists are classic Lips-style lists (singly-linked lists), where each node is a subject for axiom referencing
26: * the next node.
27: */
28: public class SimpleListDescriptorImpl implements SimpleListDescriptor {
29:
30: protected final ListDescriptor descriptor;
31:
32: public SimpleListDescriptorImpl(NamedResource listOwner, Assertion listProperty,
33: Assertion nextNodeProperty) {
34: this.descriptor = new BaseListDescriptorImpl(listOwner, listProperty, nextNodeProperty);
35: }
36:
37: @Override
38: public void setContext(URI context) {
39: descriptor.setContext(context);
40: }
41:
42: @Override
43: public URI getContext() {
44: return descriptor.getContext();
45: }
46:
47: @Override
48: public NamedResource getListOwner() {
49: return descriptor.getListOwner();
50: }
51:
52: @Override
53: public Assertion getListProperty() {
54: return descriptor.getListProperty();
55: }
56:
57: @Override
58: public Assertion getNextNode() {
59: return descriptor.getNextNode();
60: }
61:
62: @Override
63: public int hashCode() {
64: final int prime = 31;
65: int result = 1;
66: result = prime * result + descriptor.hashCode();
67: return result;
68: }
69:
70: @Override
71: public boolean equals(Object obj) {
72:• if (this == obj)
73: return true;
74:• if (obj == null)
75: return false;
76:• if (getClass() != obj.getClass())
77: return false;
78: SimpleListDescriptorImpl other = (SimpleListDescriptorImpl) obj;
79: return descriptor.equals(other.descriptor);
80: }
81:
82: @Override
83: public String toString() {
84: return "[SimpleList: " + descriptor + "]";
85: }
86: }