Skip to contentMethod: getParent()
1: /**
2: * Copyright (C) 2022 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.jopa.query.soql;
16:
17: public class SoqlNode {
18:
19: private SoqlNode parent;
20: private SoqlNode child;
21: private String value;
22: private String iri = "";
23:
24: public SoqlNode(String value) {
25: this.value = value;
26: }
27:
28: public SoqlNode(SoqlNode parent, String value) {
29: this.parent = parent;
30: this.value = value;
31: }
32:
33: public boolean hasNextChild() {
34: return this.child != null;
35: }
36:
37: public SoqlNode getChild() {
38: return this.child;
39: }
40:
41: public boolean hasNextParent() {
42: return this.parent != null;
43: }
44:
45: public SoqlNode getParent() {
46: return this.parent;
47: }
48:
49: public String getValue() {
50: return this.value;
51: }
52:
53: public String getCapitalizedValue() {
54: return this.value.substring(0, 1).toUpperCase() + this.value.substring(1);
55: }
56:
57: public void setChild(SoqlNode child) {
58: this.child = child;
59: }
60:
61: public void setParent(SoqlNode parent) {
62: this.parent = parent;
63: }
64:
65: public void setValue(String value) {
66: this.value = value;
67: }
68:
69: public String getIri() {
70: return iri;
71: }
72:
73: public void setIri(String iri) {
74: this.iri = iri;
75: }
76:
77:
78: }