01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 1997-2007.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.query.parser.serql.ast;
07:
08: public class ASTSelectQuery extends ASTTupleQuery {
09:
10: public ASTSelectQuery(int id) {
11: super (id);
12: }
13:
14: public ASTSelectQuery(SyntaxTreeBuilder p, int id) {
15: super (p, id);
16: }
17:
18: @Override
19: public Object jjtAccept(SyntaxTreeBuilderVisitor visitor,
20: Object data) throws VisitorException {
21: return visitor.visit(this , data);
22: }
23:
24: public ASTSelect getSelectClause() {
25: return (ASTSelect) children.get(0);
26: }
27:
28: public boolean hasQueryBody() {
29: return children.size() >= 2;
30: }
31:
32: public ASTQueryBody getQueryBody() {
33: if (hasQueryBody()) {
34: return (ASTQueryBody) children.get(1);
35: }
36:
37: return null;
38: }
39:
40: public boolean hasLimit() {
41: return getLimit() != null;
42: }
43:
44: public ASTLimit getLimit() {
45: return jjtGetChild(ASTLimit.class);
46: }
47:
48: public boolean hasOffset() {
49: return getOffset() != null;
50: }
51:
52: public ASTOffset getOffset() {
53: return jjtGetChild(ASTOffset.class);
54: }
55: }
|