KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > ejb > query > EmptyCompNode


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

12 package com.versant.core.ejb.query;
13
14 /**
15  * IS EMPTY and IS NOT EMPTY.
16  */

17 public class EmptyCompNode extends Node {
18
19     // todo make sure path is PathNode in annotate
20
private Node path;
21     private boolean not;
22
23     public EmptyCompNode(Node path, boolean not) {
24         this.path = path;
25         this.not = not;
26     }
27
28     public PathNode getPath() {
29         return (PathNode)path;
30     }
31
32     public boolean isNot() {
33         return not;
34     }
35
36     public Object JavaDoc arrive(NodeVisitor v, Object JavaDoc msg) {
37         return v.arriveEmptyCompNode(this, msg);
38     }
39
40     public String JavaDoc toStringImp() {
41         StringBuffer JavaDoc s = new StringBuffer JavaDoc();
42         s.append(path);
43         s.append(not ? " IS NOT EMPTY" : " IS EMPTY");
44         return s.toString();
45     }
46
47     public void resolve(ResolveContext rc) {
48         path.resolve(rc);
49     }
50
51 }
52
53
Popular Tags