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.algebra;
07:
08: /**
09: * Compares the string representation of a value expression to a pattern.
10: */
11: public class Regex extends BinaryValueOperator {
12:
13: /*-----------*
14: * Variables *
15: *-----------*/
16:
17: private ValueExpr flagsArg;
18:
19: /*--------------*
20: * Constructors *
21: *--------------*/
22:
23: public Regex() {
24: }
25:
26: public Regex(ValueExpr expr, ValueExpr pattern, ValueExpr flags) {
27: super (expr, pattern);
28: setFlagsArg(flags);
29: }
30:
31: /*---------*
32: * Methods *
33: *---------*/
34:
35: public ValueExpr getArg() {
36: return super .getLeftArg();
37: }
38:
39: public void setArg(ValueExpr leftArg) {
40: super .setLeftArg(leftArg);
41: }
42:
43: public ValueExpr getPatternArg() {
44: return super .getRightArg();
45: }
46:
47: public void setPatternArg(ValueExpr rightArg) {
48: super .setRightArg(rightArg);
49: }
50:
51: public void setFlagsArg(ValueExpr flags) {
52: this .flagsArg = flags;
53: }
54:
55: public ValueExpr getFlagsArg() {
56: return flagsArg;
57: }
58:
59: public <X extends Exception> void visit(QueryModelVisitor<X> visitor)
60: throws X {
61: visitor.meet(this );
62: }
63:
64: @Override
65: public <X extends Exception> void visitChildren(
66: QueryModelVisitor<X> visitor) throws X {
67: super .visitChildren(visitor);
68: if (flagsArg != null) {
69: flagsArg.visit(visitor);
70: }
71: }
72:
73: @Override
74: public Regex clone() {
75: Regex clone = (Regex) super.clone();
76: if (flagsArg != null) {
77: clone.setFlagsArg(flagsArg.clone());
78: }
79: return clone;
80: }
81: }
|