KickJava   Java API By Example, From Geeks To Geeks.

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


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.BindingSupportImpl;
15
16 /**
17  * This is a node with no children. Extending Node (which has children) to
18  * make this class may seem strange but lots of casting is saved in all the
19  * code the traverses Node trees.
20  */

21 public class LeafNode extends Node {
22
23     /**
24      * Set the parent link on all our children.
25      */

26     public void setParentOnChildren() {
27     }
28
29     /**
30      * Replace one node with another.
31      */

32     public void replaceChild(Node old, Node nw) {
33         throw BindingSupportImpl.getInstance().internal("replaceChild called on LeafNode");
34     }
35
36     /**
37      * Simplify this node tree as much as possible.
38      */

39     public void normalizeImp() {
40     }
41
42     public Field visit(MemVisitor visitor, Object JavaDoc obj) {
43         return visitor.visitLeafNode(this, obj);
44     }
45
46     public Object JavaDoc arrive(NodeVisitor v, Object JavaDoc msg) {
47         return v.arriveLeafNode(this, msg);
48     }
49 }
50
Popular Tags