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 class ASTVar extends ASTValueExpr {
09:
10: private String name;
11:
12: private boolean anonymous = false;
13:
14: public ASTVar(int id) {
15: super (id);
16: }
17:
18: public ASTVar(SyntaxTreeBuilder p, int id) {
19: super (p, id);
20: }
21:
22: @Override
23: public Object jjtAccept(SyntaxTreeBuilderVisitor visitor,
24: Object data) throws VisitorException {
25: return visitor.visit(this , data);
26: }
27:
28: public String getName() {
29: return name;
30: }
31:
32: public void setName(String name) {
33: this .name = name;
34: }
35:
36: public boolean isAnonymous() {
37: return anonymous;
38: }
39:
40: public void setAnonymous(boolean anonymous) {
41: this .anonymous = anonymous;
42: }
43:
44: @Override
45: public String toString() {
46: String result = super .toString() + " (" + name + ")";
47:
48: if (anonymous) {
49: result += " (anonymous)";
50: }
51:
52: return result;
53: }
54: }
|