/
ASTPathExprTail.java
51 lines (40 loc) · 1.35 KB
/
ASTPathExprTail.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*******************************************************************************
* Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Distribution License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*******************************************************************************/
package org.eclipse.rdf4j.query.parser.serql.ast;
public abstract class ASTPathExprTail extends SimpleNode {
private boolean isBranch = false;
protected ASTPathExprTail(int id) {
super(id);
}
protected ASTPathExprTail(SyntaxTreeBuilder p, int id) {
super(p, id);
}
public boolean isBranch() {
return isBranch;
}
public void setBranch(boolean isBranch) {
this.isBranch = isBranch;
}
public boolean hasNextTail() {
return getNextTail() != null;
}
/**
* Gets the path epxression tail following this part of the path expression, if any.
*
* @return The next part of the path expression, or <tt>null</tt> if this is the last part of the path expression.
*/
public abstract ASTPathExprTail getNextTail();
@Override
public String toString() {
String result = super.toString();
if (isBranch) {
result += " (branch)";
}
return result;
}
}