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: import java.util.List;
09:
10: import info.aduna.collections.CastingList;
11:
12: public class ASTConstruct extends SimpleNode {
13:
14: private boolean distinct = false;
15:
16: private boolean wildcard = false;
17:
18: public ASTConstruct(int id) {
19: super (id);
20: }
21:
22: public ASTConstruct(SyntaxTreeBuilder p, int id) {
23: super (p, id);
24: }
25:
26: @Override
27: public Object jjtAccept(SyntaxTreeBuilderVisitor visitor,
28: Object data) throws VisitorException {
29: return visitor.visit(this , data);
30: }
31:
32: public void setDistinct(boolean distinct) {
33: this .distinct = distinct;
34: }
35:
36: public boolean isDistinct() {
37: return distinct;
38: }
39:
40: public boolean isWildcard() {
41: return wildcard;
42: }
43:
44: public void setWildcard(boolean wildcard) {
45: this .wildcard = wildcard;
46: }
47:
48: public List<ASTPathExpr> getPathExprList() {
49: return new CastingList<ASTPathExpr>(children);
50: }
51:
52: @Override
53: public String toString() {
54: String result = super .toString();
55:
56: if (distinct) {
57: result += " (distinct)";
58: }
59:
60: if (wildcard) {
61: result += " (*)";
62: }
63:
64: return result;
65: }
66: }
|