KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > jdo > query > ImportNode


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.jdo.query;
13
14 import com.versant.core.common.Debug;
15
16 /**
17  * An import declaration for a query.
18  */

19 public class ImportNode extends LeafNode {
20
21     public String JavaDoc name;
22     public boolean all;
23
24     public ImportNode() {
25     }
26
27     public String JavaDoc toString() {
28         return super.toString() + ": " + name + (all ? "*" : "");
29     }
30
31     public Field visit(MemVisitor visitor, Object JavaDoc obj) {
32         return visitor.visitImportNode(this, obj);
33     }
34
35     public void dump(String JavaDoc indent) {
36         Debug.OUT.println(indent + this);
37     }
38
39     public String JavaDoc getClassName() {
40         if (all) return null;
41         int i = name.lastIndexOf('.');
42         if (i >= 0) return name.substring(i + 1);
43         return name;
44     }
45
46     public Object JavaDoc arrive(NodeVisitor v, Object JavaDoc msg) {
47         return v.arriveImportNode(this, msg);
48     }
49
50 }
51
Popular Tags