01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 1997-2006.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.query.parser.serql.ast;
07:
08: public abstract class ASTPathExprTail extends SimpleNode {
09:
10: private boolean isBranch = false;
11:
12: public ASTPathExprTail(int id) {
13: super (id);
14: }
15:
16: public ASTPathExprTail(SyntaxTreeBuilder p, int id) {
17: super (p, id);
18: }
19:
20: public boolean isBranch() {
21: return isBranch;
22: }
23:
24: public void setBranch(boolean isBranch) {
25: this .isBranch = isBranch;
26: }
27:
28: public boolean hasNextTail() {
29: return getNextTail() != null;
30: }
31:
32: /**
33: * Gets the path epxression tail following this part of the path expression,
34: * if any.
35: *
36: * @return The next part of the path expression, or <tt>null</tt> if this
37: * is the last part of the path expression.
38: */
39: public abstract ASTPathExprTail getNextTail();
40:
41: @Override
42: public String toString() {
43: String result = super .toString();
44:
45: if (isBranch) {
46: result += " (branch)";
47: }
48:
49: return result;
50: }
51: }
|