KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > codehaus > groovy > ast > expr > NotExpression


1 /*
2  * Copyright 2003 (C) Sam Pullara. All Rights Reserved.
3  *
4  * Redistribution and use of this software and associated documentation
5  * ("Software"), with or without modification, are permitted provided that the
6  * following conditions are met: 1. Redistributions of source code must retain
7  * copyright statements and notices. Redistributions must also contain a copy
8  * of this document. 2. Redistributions in binary form must reproduce the above
9  * copyright notice, this list of conditions and the following disclaimer in
10  * the documentation and/or other materials provided with the distribution. 3.
11  * The name "groovy" must not be used to endorse or promote products derived
12  * from this Software without prior written permission of The Codehaus. For
13  * written permission, please contact info@codehaus.org. 4. Products derived
14  * from this Software may not be called "groovy" nor may "groovy" appear in
15  * their names without prior written permission of The Codehaus. "groovy" is a
16  * registered trademark of The Codehaus. 5. Due credit should be given to The
17  * Codehaus - http://groovy.codehaus.org/
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE CODEHAUS AND CONTRIBUTORS ``AS IS'' AND ANY
20  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  * DISCLAIMED. IN NO EVENT SHALL THE CODEHAUS OR ITS CONTRIBUTORS BE LIABLE FOR
23  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
29  * DAMAGE.
30  *
31  */

32 package org.codehaus.groovy.ast.expr;
33
34 import org.codehaus.groovy.ast.GroovyCodeVisitor;
35
36 /**
37  * @author sam
38  */

39 public class NotExpression extends BooleanExpression {
40
41     public NotExpression(Expression expression) {
42         super(expression);
43     }
44
45     public void visit(GroovyCodeVisitor visitor) {
46         visitor.visitNotExpression(this);
47     }
48
49     public boolean isDynamic() {
50         return false;
51     }
52
53     public Expression transformExpression(ExpressionTransformer transformer) {
54         return new NotExpression(transformer.transform(getExpression()));
55     }
56     }
57
Popular Tags