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 ASTLike extends ASTBooleanExpr {
09:
10: private boolean ignoreCase = false;
11:
12: public ASTLike(int id) {
13: super (id);
14: }
15:
16: public ASTLike(SyntaxTreeBuilder p, int id) {
17: super (p, id);
18: }
19:
20: @Override
21: public Object jjtAccept(SyntaxTreeBuilderVisitor visitor,
22: Object data) throws VisitorException {
23: return visitor.visit(this , data);
24: }
25:
26: public boolean ignoreCase() {
27: return ignoreCase;
28: }
29:
30: public void setIgnoreCase(boolean ignoreCase) {
31: this .ignoreCase = ignoreCase;
32: }
33:
34: public ASTValueExpr getValueExpr() {
35: return (ASTValueExpr) children.get(0);
36: }
37:
38: public ASTString getPattern() {
39: return (ASTString) children.get(1);
40: }
41:
42: @Override
43: public String toString() {
44: String result = super .toString();
45:
46: if (ignoreCase) {
47: result += " (ignore case)";
48: }
49:
50: return result;
51: }
52: }
|